Hard to find Nullpointer Exception.

This is the first time I've come across this type of NullPointerException and it took me a couple of minutes to figure out why. I thought others would benefit from seeing it, if they haven't already. This code fragment is part of a large switch statement. Just for a little fun I'll give a little reward. 5 Dukes to the first person who can give me the correct answer why.

publicstaticvoid main(String[] args)throws Exception{

processObject(null);

}

staticvoid processObject(Object obj){

//next line throws NullPointerException. Why?

processDouble(objinstanceof Long ? ((Long)obj).doubleValue() : (Double)obj);

}

staticvoid processDouble(Double d){}

By the way this is my first thread that I've started here.

[1303 byte] By [Caffeine0001a] at [2007-10-2 7:34:47]
# 1
NPEs ar enot hard to find at all. They come with something called a stack trace which prints exactly the line where they occur. And then just check what's in that line that could be null.
CeciNEstPasUnProgrammeura at 2007-7-16 21:15:58 > top of Java-index,Java Essentials,Java Programming...
# 2
Oops. Sorry. I'm already asleep.
CeciNEstPasUnProgrammeura at 2007-7-16 21:15:58 > top of Java-index,Java Essentials,Java Programming...
# 3
One hint, since I can't think straight anymore: replace that ternary operator with a more readable if and get a closer pinpoint to the occurence of the NPE.
CeciNEstPasUnProgrammeura at 2007-7-16 21:15:58 > top of Java-index,Java Essentials,Java Programming...
# 4
well you are passing null in the processObject method aren't you?
Gorteoa at 2007-7-16 21:15:58 > top of Java-index,Java Essentials,Java Programming...
# 5
> One hint, since I can't think straight anymore:> replace that ternary operator with a more readable if> and get a closer pinpoint to the occurence of the NPE.Hint 1. Without the ternary operator it won't give a NullpointerException.
Caffeine0001a at 2007-7-16 21:15:58 > top of Java-index,Java Essentials,Java Programming...
# 6
> well you are passing null in the processObject method> aren't you?Wrong. Next person
Caffeine0001a at 2007-7-16 21:15:58 > top of Java-index,Java Essentials,Java Programming...
# 7
ok then can you tell me why it does not throw a nullPointerException if you pass processObject(new Double(1.02)); I really want to know
Gorteoa at 2007-7-16 21:15:58 > top of Java-index,Java Essentials,Java Programming...
# 8

> well you are passing null in the processObject method

> aren't you?

Yes, but that doesn't automatically mean NPE. What specifically do you think is causing the NPE?

And it gets better, you don't even need the doubleValue.

processDouble((obj instanceof Long) ? ((Long)obj) : (Double)obj); // throws

processDouble((obj instanceof Long) ? ((Double)obj) : (Long)obj); // throws

processDouble((obj instanceof Long) ? ((Double)obj) : (Double)obj); // doesn't throw

jverda at 2007-7-16 21:15:58 > top of Java-index,Java Essentials,Java Programming...
# 9

> ok then can you tell me why it does not throw a

> nullPointerException if you pass >processObject(new Double(1.02));

true.

> I really want to know

It took 3 programmers at my work about 5 minutes to figure this one out. Do you think I'm going to give the answer away yet.

Do I need to give out another hint?

Caffeine0001a at 2007-7-16 21:15:58 > top of Java-index,Java Essentials,Java Programming...
# 10

> It took 3 programmers at my work about 5 minutes to

> figure this one out. Do you think I'm going to give

> the answer away yet.

Pfft. I've been at work for 16 hours now. Do you think I really feel like taking one of your "decipher my crappy code" quizzes? If you know the answer, buzz off and don't ask here.

CeciNEstPasUnProgrammeura at 2007-7-16 21:15:58 > top of Java-index,Java Essentials,Java Programming...
# 11

> > It took 3 programmers at my work about 5 minutes

> to

> > figure this one out. Do you think I'm going to

> give

> > the answer away yet.

>

> Pfft. I've been at work for 16 hours now. Do you

> think I really feel like taking one of your "decipher

> my crappy code" quizzes? If you know the answer, buzz

> off and don't ask here.

Unlike most of these, this one is actually interesting, IMAO.

@Caffeine: Shall I post the relevant section of the JLS?

jverda at 2007-7-16 21:15:58 > top of Java-index,Java Essentials,Java Programming...
# 12
> Hint 1. Without the ternary operator it won't give a> NullpointerException.I disagree. It will happen with null.doubleValue()Target exception: java.lang.NullPointerException: Attempt to invoke method doubleValue on null value
ChuckBinga at 2007-7-16 21:15:58 > top of Java-index,Java Essentials,Java Programming...
# 13

> It took 3 programmers at my work about 5 minutes to

> figure this one out. Do you think I'm going to give

> the answer away yet.

Do you really think that your stupid little puzzle will make me lose my sleep?

Keep it mate. It's all your. I am getting enough at work

Gorteoa at 2007-7-16 21:15:58 > top of Java-index,Java Essentials,Java Programming...
# 14
> > It will happen with null.doubleValue()> The "instance of" operator prevents that
Caffeine0001a at 2007-7-16 21:15:58 > top of Java-index,Java Essentials,Java Programming...
# 15
> > > > It will happen with null.doubleValue()> > > > The "instance of" operator prevents thatIt only prevents the one that you have explicitly placed there...
jverda at 2007-7-20 19:22:02 > top of Java-index,Java Essentials,Java Programming...
# 16
The original code doesn't even compile for me. But, I don't have the 1.5 required for autoboxing.
MLRona at 2007-7-20 19:22:02 > top of Java-index,Java Essentials,Java Programming...
# 17

[url http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.25]15.25 Conditional Operator[/url]

If the second and third operands have the same type (which may be the null type), then that is the type of the conditional expression.

...

Otherwise, binary numeric promotion (5.6.2) is applied to the operand types, and the type of the conditional expression is the promoted type of the second and third operands. Note that binary numeric promotion performs unboxing conversion (5.1.8) and value set conversion (5.1.13).[/code]

[url http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#190699]5.1.8 Unboxing Conversion[/url]

If r is a reference of type Double, then unboxing conversion converts r into r.doubleValue()

jverda at 2007-7-20 19:22:02 > top of Java-index,Java Essentials,Java Programming...
# 18

It would have to be something Java1.5 specific.

This won't even compile in Java1.4: A ternary operator must resolve to the same type whichever choice is evaluated.

Here one choice evaluates to a double, the other to a Double.

I guess autoboxing rears its ugly head, and causes the NPE.

Of course thats just a guess. I still haven't got into 1.5 :-(

evnafetsa at 2007-7-20 19:22:02 > top of Java-index,Java Essentials,Java Programming...
# 19
> Of course thats just a guess. I still haven't got into 1.5 :-(I haven't, either. We only got up to 1.4.2 last Friday--had been on 1.3.1 until then.
MLRona at 2007-7-20 19:22:02 > top of Java-index,Java Essentials,Java Programming...
# 20

> [url

> http://java.sun.com/docs/books/jls/third_edition/html/

> expressions.html#15.25]15.25 Conditional

> Operator[/url]

> If the second and third operands have the same type

> (which may be the null type), then that is the type

> of the conditional expression.

> ...

> Otherwise, binary numeric promotion (5.6.2) is

> applied to the operand types, and the type of the

> conditional expression is the promoted type of the

> second and third operands. Note that binary numeric

> promotion performs unboxing conversion (5.1.8) and

> value set conversion (5.1.13).[/code]

>

> [url

> http://java.sun.com/docs/books/jls/third_edition/html/

> conversions.html#190699]5.1.8 Unboxing

> Conversion[/url]

> If r is a reference of type Double, then unboxing

> conversion converts r into r.doubleValue()

Correct.

Caffeine0001a at 2007-7-20 19:22:02 > top of Java-index,Java Essentials,Java Programming...
# 21

> Unlike most of these, this one is actually

> interesting, IMAO.

Well, okay. I take half of it back. I would have liked to see a post explaining what he has seen (it is interesting, you know my opinion about autoboxing), but not a time-wasting quiz. Why didn't the OP just post his stuff to comment on, especially since obviously a lot of us are not using 1.5.0, including me.

CeciNEstPasUnProgrammeura at 2007-7-20 19:22:02 > top of Java-index,Java Essentials,Java Programming...
# 22

> > Unlike most of these, this one is actually

> > interesting, IMAO.

>

> Well, okay. I take half of it back. I would have

> liked to see a post explaining what he has seen (it

> is interesting, you know my opinion about

> autoboxing), but not a time-wasting quiz. Why didn't

> the OP just post his stuff to comment on, especially

> since obviously a lot of us are not using 1.5.0,

> including me.

As I stated, in the original post. I said the purpose was two fold. To show an obscure cause of a NPE and to have some fun. Basically allow jverd to show his mighty intellect.

Caffeine0001a at 2007-7-20 19:22:02 > top of Java-index,Java Essentials,Java Programming...
# 23

> As I stated, in the original post. I said the

> purpose was two fold. To show an obscure cause of a

> NPE and to have some fun. Basically allow jverd to

> show his mighty intellect.

ROFL!

More like mighty JLS-opening, "conditional"-searching, link-clicking, text-skimming power.

Cower before Me, puny mortals.

jverda at 2007-7-20 19:22:02 > top of Java-index,Java Essentials,Java Programming...
# 24
> More like mighty JLS-opening,> "conditional"-searching, link-clicking, text-skimming> power.That's certaily more than most people have. :)> Cower before Me, puny mortals.Nope.
CeciNEstPasUnProgrammeura at 2007-7-20 19:22:02 > top of Java-index,Java Essentials,Java Programming...
# 25
> > Cower before Me, puny mortals.> > Nope.Pretty please? Maybe just a little? How about acting slighly apprehensive? Aww man, my mom was right. I suck at being a deity.
jverda at 2007-7-20 19:22:02 > top of Java-index,Java Essentials,Java Programming...
# 26

> Pretty please? Maybe just a little? How about acting

> slighly apprehensive? Aww man, my mom was right. I

> suck at being a deity.

Believe me, being a deity isn't all it's cracked up to be. E.g. nobody sacrifices virgins anymore. All you get is an occasional rabbit.

CeciNEstPasUnProgrammeura at 2007-7-20 19:22:02 > top of Java-index,Java Essentials,Java Programming...
# 27

@OP If you are going to be posting "guess why my crappy piece of **** code, gives me **** results" style questions, you could at least mark them as being such (Oh, I don't know... How about: "Here is a crappy piece of code that tests your knowledge of the JLS"), and it would also be nice if you could point out that you are using 1.5 specific features.

macrules2a at 2007-7-20 19:22:02 > top of Java-index,Java Essentials,Java Programming...
# 28

******* cunts and their stupid ******* language filter.... For the love of ****, what is wrong with a combination of letters that is sooooooooo ******* bad that they feel the need to ******* censor them...

****!

****!

****!

****!

****!

****!

****!

****!

****!

****!

****!

macrules2a at 2007-7-20 19:22:02 > top of Java-index,Java Essentials,Java Programming...
# 29
I don't think "cunts" needs escaping. Shows how moronic the filter is.
CeciNEstPasUnProgrammeura at 2007-7-20 19:22:02 > top of Java-index,Java Essentials,Java Programming...
# 30

> @OP If you are going to be posting "guess why my

> crappy piece of **** code, gives me **** results"

> style questions, you could at least mark them as

> being such (Oh, I don't know... How about: "Here is a

> crappy piece of code that tests your knowledge of the

> JLS"),

I thought it was fairly obvious that he was posting this as a heads-up for others that might run into this kind of thing and as a a puzzle for any geeks (whistles, looks around nonchalantly...) who might enjoy that sort of thing. But then, that may be because I recognized his login from some of the threads he's answered.

> and it would also be nice if you could point

> out that you are using 1.5 specific features.

Was it that hard to figure out that it needs 1.5? ;-)

jverda at 2007-7-20 19:22:07 > top of Java-index,Java Essentials,Java Programming...
# 31

> I thought it was fairly obvious that he was posting

> this as a heads-up for others that might run into

> this kind of thing and as a a puzzle for any geeks

> (whistles, looks around nonchalantly...) who might

> enjoy that sort of thing. But then, that may be

> because I recognized his login from some of the

> threads he's answered.

I recognized his name but wasn't able to fully understand what he wrote anymore. :p I really apologize to the OP.

> Was it that hard to figure out that it needs 1.5? ;-)

To me, yes. Because I really wondered why a cast would throw an NPE.

CeciNEstPasUnProgrammeura at 2007-7-20 19:22:07 > top of Java-index,Java Essentials,Java Programming...
# 32
> > Was it that hard to figure out that it needs 1.5?> ;-)> > To me, yes. Because I really wondered why a cast> would throw an NPE.Racist.
jverda at 2007-7-20 19:22:07 > top of Java-index,Java Essentials,Java Programming...
# 33

> enjoy that sort of thing. But then, that may be

> because I recognized his login from some of the

> threads he's answered.

I've been away for too long then, I guess.

> Was it that hard to figure out that it needs 1.5? ;-)

For those of us who haven't used 1.5 yet, I would say yes.

macrules2a at 2007-7-20 19:22:07 > top of Java-index,Java Essentials,Java Programming...
# 34
> > Was it that hard to figure out that it needs 1.5?> ;-)> > For those of us who haven't used 1.5 yet, I would say> yes.Okay, fair enough.
jverda at 2007-7-20 19:22:07 > top of Java-index,Java Essentials,Java Programming...
# 35

> > > Was it that hard to figure out that it needs

> 1.5?

> > ;-)

> >

> > For those of us who haven't used 1.5 yet, I would

> say

> > yes.

>

> Okay, fair enough.

I specifically withheld that it was 1.5. It was going to be hint 2.That was the hardest part of the problem. After rewriting my coworkers code and realizing that it is a 1.5 feature that was causing the NPE, it was really easy to figure out that autoboxing was involved in causing the NPE.

I could have gone through all the steps I used to find the answer, but where is the fun it that. Those critical of such posts, all I got to say is we geeks need to have fun sometimes. Since this is a open forum to all who post you have several choices. Some which are to ignore the post, criticize the post, or try to solve the problem. Any and all post were welcome including those whose criticize me. And since this is the only one of these quiz - problem solving posts I've done under this nick, longer if you include my previous nick, you can rest assured It will be a while before I do another.

And to those who were not clear as to the purpose of this post. Java is my first language and English my second, third, and sometimes fourth. So if you could give me a better Disclaimer I would appreciate it. Although I will probably forget it by the time I post another.

Since deities were mentioned. I will now make a prophetic statement. Some professor at some University will make an autoboxing NPE homework assignment and that question will be asked in these forums next year. So get ready. :)

Caffeine0001a at 2007-7-20 19:22:07 > top of Java-index,Java Essentials,Java Programming...
# 36

> Since deities were mentioned. I will now make a

> prophetic statement. Some professor at some

> University will make an autoboxing NPE homework

> assignment and that question will be asked in these

> forums next year. So get ready. :)

And most likely the prof won't understand why it behaves that way.

jverda at 2007-7-20 19:22:07 > top of Java-index,Java Essentials,Java Programming...
# 37

> > Since deities were mentioned. I will now make a

> > prophetic statement. Some professor at some

> > University will make an autoboxing NPE homework

> > assignment and that question will be asked in

> these

> > forums next year. So get ready. :)

>

> And most likely the prof won't understand why it

> behaves that way.

LOL

Caffeine0001a at 2007-7-20 19:22:07 > top of Java-index,Java Essentials,Java Programming...
# 38

> > Since deities were mentioned. I will now make a

> > prophetic statement. Some professor at some

> > University will make an autoboxing NPE homework

> > assignment and that question will be asked in

> these

> > forums next year. So get ready. :)

>

> And most likely the prof won't understand why it

> behaves that way.

And the answer he gives will be posted in another thread as the "truth" and a massive argument will rage for 100 pages (@15ppp) and then a feature request will be added to the bug parade, and it will overtake the request for operator overloading... Or something.

macrules2a at 2007-7-20 19:22:07 > top of Java-index,Java Essentials,Java Programming...
# 39

> And it gets better, you don't even need the doubleValue. > processDouble((obj instanceof Long) ? ((Long)obj) : (Double)obj); // throws

That one surprised me, although it shouldn't have (I missed a later deference in my supposition).

Interesting subquestion: what's the type of that ternary? My guess would be Number, whereas for the original I think it was double.

YAT_Archivista at 2007-7-20 19:22:07 > top of Java-index,Java Essentials,Java Programming...
# 40

> Interesting subquestion: what's the type of that

> ternary? My guess would be Number, whereas for the

> original I think it was double.

If you follow the JLS links in reply 17, it looks like it's double.

Unboxing gives long and double, and 15.25 Conditional Operator refers to [url http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#170983]5.6.2 Binary Numeric Promotion[/url], which says If either operand is of type double, the other is converted to double.

jverda at 2007-7-20 19:22:07 > top of Java-index,Java Essentials,Java Programming...
# 41
> If you follow the JLS links in reply 17, it looks like it's double.Yes, you're right. That's rubbish, because it's a source of information loss. I think Number would be far better.
YAT_Archivista at 2007-7-20 19:22:07 > top of Java-index,Java Essentials,Java Programming...
# 42

> > If you follow the JLS links in reply 17, it looks

> like it's double.

>

> Yes, you're right. That's rubbish, because it's a

> source of information loss.

In what sense? The conversion of an object to a primitive?

> I think Number would be

> far better.

Because...?

I'm neither agreeing nor disagreeing. Just not seeing where you're coming from.

jverda at 2007-7-20 19:22:07 > top of Java-index,Java Essentials,Java Programming...
# 43

> In what sense? The conversion of an object to a primitive?

The conversion of a Long to a double.

> Because...?

Both Long and Double can be cast to Number without any loss of numerical information. The only thing you lose is compile-time type knowledge, and that can be restored.

YAT_Archivista at 2007-7-20 19:22:07 > top of Java-index,Java Essentials,Java Programming...
# 44

public class Ternary

{

public static void main(String[] args)

{

long original = 0xcafebabecafebabeL;

Number foo = foo(original);

System.out.println(original);

System.out.println(foo.getClass());

System.out.println(foo);

System.out.println(original == foo);

}

public static Number foo(Object obj)

{

return (obj instanceof Long) ? (Long)obj : (Double)obj;

}

}

Ask anyone who hasn't participated in this discussion what the results are and they'll expect something like -3819410105351357762

class java.lang.Long

-3819410105351357762

trueThat's what you'd get if it didn't unbox (Long)obj and (Double)obj before resolving the type. Frankly it's not at all obvious that you have unboxing and boxing in that line, such that the object returned is never reference-equal to obj, and instead you get -3819410105351357762

class java.lang.Double

-3.819410105351358E18

false

YAT_Archivista at 2007-7-20 19:22:07 > top of Java-index,Java Essentials,Java Programming...
# 45

> > In what sense? The conversion of an object to a

> primitive?

>

> The conversion of a Long to a double.

>

> > Because...?

>

> Both Long and Double can be cast to Number without

> any loss of numerical information. The only thing you

> lose is compile-time type knowledge, and that can be

> restored.

Okay.

Care to take a stab at explaining what your rules for (obj instanceof Long) ? ((Long)obj) : (Double)obj)

would be?

jverda at 2007-7-20 19:22:12 > top of Java-index,Java Essentials,Java Programming...
# 46

I think it may be as simple as changing the JLS text in 15.25 from

Otherwise, if the second and third operands have types that are convertible (5.1.8) to numeric types

to

Otherwise, if one of the second and third operands has a numeric type and the other has a type which is convertible (5.1.8) to a numeric type

Then (Long, Double) drops past that case into the final one, and the ternary is typed (subject to subtleties from capture conversion) as lub(Long, Double).

YAT_Archivista at 2007-7-20 19:22:12 > top of Java-index,Java Essentials,Java Programming...
# 47

import java.util.*;

/**

* What is the output of this application?

* Why?

*/

public class Ternary

{

public static void main(String[] args)

{

Object foo = new Long(0xcafebabecafebabeL);

List<Object> bars = new ArrayList<Object>();

bars.add(bool() ? (Long)foo : (Number)foo);

bars.add(bool() ? (Long)foo : (Long)foo);

bars.add(bool() ? (Long)foo : (Double)foo);

bars.add(bool() ? (Long)foo : ((Long)foo).longValue());

for (Object bar : bars)

{

System.out.println(foo == bar);

System.out.println(foo.equals(bar));

}

}

public static boolean bool()

{

return true;

}

}

I defy anyone who hasn't recently read section 15.25 of the JLS to correctly predict the output without looking anything up in the JLS.

YAT_Archivista at 2007-7-20 19:22:12 > top of Java-index,Java Essentials,Java Programming...
# 48

> I defy anyone who hasn't recently read

> section 15.25 of the JLS to correctly predict the

> output without looking anything up in the JLS.

I find it neither surprising nor dismaying that the type of a conditional expression with mixed types for the 2nd and 3rd args is not intuitive and requires a read of the relevan bits of the JLS to know. :-)

jverda at 2007-7-20 19:22:12 > top of Java-index,Java Essentials,Java Programming...
# 49
> I find it neither surprising nor dismaying <snip>I find it both, because I'm used to type inference in languages like SML, and expected (and, up to now, found) Java 1.5's type inference to be similar.
YAT_Archivista at 2007-7-20 19:22:12 > top of Java-index,Java Essentials,Java Programming...
# 50

> > I find it neither surprising nor dismaying <snip>

>

> I find it both, because I'm used to type inference in

> languages like SML, and expected (and, up to now,

> found) Java 1.5's type inference to be similar.

Ever use C++? Were you surprised and dismayed at all the things that were similar but not identical, and therefore required you to read a reference to find out how they really worked?

(Just being obnoxious for the fun of it.)

jverda at 2007-7-20 19:22:12 > top of Java-index,Java Essentials,Java Programming...
# 51
> Ever use C++?I have the good fortune to be able to truthfully answer "No".
YAT_Archivista at 2007-7-20 19:22:12 > top of Java-index,Java Essentials,Java Programming...
# 52
> > Ever use C++?> > I have the good fortune to be able to truthfully> answer "No".Oh.(shuffles off, hands in pockets, pouting, mumbling about how nobody will play with me)
jverda at 2007-7-20 19:22:12 > top of Java-index,Java Essentials,Java Programming...
# 53
> Oh.> > (shuffles off, hands in pockets, pouting, mumbling> about how nobody will play with me)Racist.
yawmarka at 2007-7-20 19:22:12 > top of Java-index,Java Essentials,Java Programming...
# 54
> > Oh.> > > > (shuffles off, hands in pockets, pouting, mumbling> > about how nobody will play with me)> > Racist.Boogerhead.
jverda at 2007-7-20 19:22:12 > top of Java-index,Java Essentials,Java Programming...
# 55
> > Racist.> > Boogerhead.Rubber, glue, and all that blather.
yawmarka at 2007-7-20 19:22:12 > top of Java-index,Java Essentials,Java Programming...
# 56
> > > Racist.> > > > Boogerhead.> > Rubber, glue, and all that blather.Hey, look! Here comes a girl! Let's throw pinecones at her!
jverda at 2007-7-20 19:22:12 > top of Java-index,Java Essentials,Java Programming...
# 57

> import java.util.*;

>

> /**

> * What is the output of this application?

> * Why?

> */

> public class Ternary

> {

>public static void main(String[] args)

>{

> Object foo = new Long(0xcafebabecafebabeL);

> List<Object> bars = new ArrayList<Object>();

> bars.add(bool() ? (Long)foo : (Number)foo);

> bars.add(bool() ? (Long)foo : (Long)foo);

> bars.add(bool() ? (Long)foo : (Double)foo);

> bars.add(bool() ? (Long)foo :

> ng)foo : ((Long)foo).longValue());

> for (Object bar : bars)

> {

> System.out.println(foo == bar);

> System.out.println(foo.equals(bar));

> }

>}

>

>public static boolean bool()

>{

> return true;

>}

> }

I defy anyone who hasn't recently read

> section 15.25 of the JLS to correctly predict the

> output without looking anything up in the JLS.

false

true

false

false

I don't know much about autoboxing/unboxing but that'd be my guess. Of coruse, that's only because I read a few months ago that it gets turned into a double though I've never read that part of the JLS myself.

kablaira at 2007-7-20 19:22:12 > top of Java-index,Java Essentials,Java Programming...
# 58

> I don't know much about autoboxing/unboxing but

> that'd be my guess. Of coruse, that's only because I

> read a few months ago that it gets turned into a

> double though I've never read that part of the JLS

> myself.

Your 1 month and 1 day late. :)

Caffeine0001a at 2007-7-20 19:22:12 > top of Java-index,Java Essentials,Java Programming...
# 59

> > I don't know much about autoboxing/unboxing but

> > that'd be my guess. Of coruse, that's only because

> I

> > read a few months ago that it gets turned into a

> > double though I've never read that part of the JLS

> > myself.

>

> Your 1 month and 1 day late. :)

Not really, I wasn't replying to your quizz, I was replying to what whoever posted that code was and there was no time limit on responses to that. It's still an interesting subject after all and I ran it myself after I posted and found I was way off.

kablaira at 2007-7-20 19:22:12 > top of Java-index,Java Essentials,Java Programming...