aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Wrapper classes doubt? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Wrapper classes doubt?" Watch "Wrapper classes doubt?" New topic
Author

Wrapper classes doubt?

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9426
    
    2

Hi Guys,

The below question is from Dan Chisholm's website,


Answer is given as K. I'm confused. Please help!


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Vinayagar Karpagam
Ranch Hand

Joined: Apr 09, 2006
Posts: 72
I could think of a problem only in line 5. But that too when I tried, there was no error and i could see .1e1d is taken as (.1 * pow(10,1)) = 1.0.
Similarly, .1e2d is treated as (.1 * pow(10, 2)) = 10.0.
Micheal John
Ranch Hand

Joined: Nov 01, 2006
Posts: 344
Go thru' the below link:
3.10.2 Floating-Point Literals - JLS


Micheal John
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT
Anuragk kushwaha
Ranch Hand

Joined: Aug 02, 2006
Posts: 51
Hi jothi,

no probs at all.......above code compile and run
with output
1) 1.0
2) 1.0
3) 1.0
4) 10.0
5) 1.0

because--->>

"All the wrapper classes except Character have two constructors -- one that takes the primitive value and another that takes the String representation of the value. For instance:"

Integer i1 = new Integer(50);
Integer i2 = new Integer("50");
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Wrapper classes doubt?