Explicitly and without apology a marketing vehicle MaryMaryQuiteContrary

Friday Aug 06, 2004

I am deeeee-lighted to announce that Dr. Josh and Dr. Neal

continue to be sponsors of our Friday Free Stuff game!!! That's right, Click and Hack the type-it brothers are sticking with me ...

through thick and thin. (this picture here isn't entirely true-to-life anymore... things change, you know...)

And some things stay the same... Dr. Josh's book -- you've got to buy it. It's a must-read. My book club is discussing this month. You're welcome to join us. It's at my house on the 23rd; 3-5 p.m.. We're having cake and champagne for Ginny. She just got married. But her mother died right afterwards. I haven't sent her a card (for either) because I don't know what to do.  It's really sad, about her mom. But it's really great that she got married.  Anyway, book club at my house... But you have to read the book to come. And you've got to buy it to read it. I digress... sort of... 

So we've got two things going on right now:

1. Those two guys are pretty busy at this very minute as we speak. 

and

2. I've got a very complicated reason why I can't access my Sun email account right now. It's a big headache.  You don't want to know.

So they may have sent me a new puzzler and it's sitting in my in-box and i can't get to it. Or maybe they were too busy because they are after all techno celebs and they're super busy right now. I happen to know first hand, actually.

In any case, this week we're running with a *new-to-you* puzzler.

But first let's talk about our prize!

It's a genuine, authentic, NWOT* brand new never been used JavaOne 2004 conference bag. But wait, there's more -- a leather Kenneth Cole PDA case (PDA not included). And just when you thought you couldn't stand it -- a really nice Java watch. (Ladies model. Sorry guys, it's the best I could do. There's one other minor flaw with the watch but it doesn't keep it from being a must-have fashion accessory for the fall.)

And this fabulous package of prizes** goes to the person who most correctly or in some other arbitrary way answers (in the comments section of this blog entry) the following:

Provide definitions for x and i so that:

   x = x + i; // (3)

is a legal statement, but

   x += i;    // (4)

is not.

And guess what else.

You don't even have to know Java to solve this.

You resourceful types might discover that your free 30 min JavaOne Online trial could pay off in ways you never even imagined.

that's all for today everybody.

bon weekend!

mary

*NWOT=It's brand new but it doesn't actually have any tags.

**Friday Free Stuff is not a contest. It's me giving away something that I personally own to somebody that I choose. I pay for postage with stamps that I buy at the post office.

 

Comments:

Let: Object x = ...; String i = ...; (3)'s okay because the left-hand side is a variable of type Object and the right-hand side is a expression of type String. (4)'s not okay because the left-hand side has an object reference type other than String.

Posted by Kris Schneider on August 06, 2004 at 01:05 PM PDT #

Yeah! Kris is right. All compound assignment operators requires both operands to be of primitive types except += which allows any right-hand operand if left-hand is a String. So the answer must be a Kris states x must be an object reference other than String.

Posted by Lars Borup on August 07, 2004 at 04:40 AM PDT #

Right. The specific reference in the JLS for (4) is the first sentence of "15.26.2 Compound Assignment Operators". As for (3), there are actually a bunch of pieces of the JLS that come into play, but basically, "x + i" would evaluate to a String which can be assigned to x through a widening reference conversion.

Posted by Kris Schneider on August 07, 2004 at 07:05 AM PDT #

and we have a winner! Kris, you win!!! Lars, no worries... will throw in something extra in the Free Stuff for you too.

Posted by mary on August 09, 2004 at 02:53 PM PDT #

Post a Comment:
Comments are closed for this entry.