wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Wrapper Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Wrapper Class" Watch "Wrapper Class" New topic
Author

Wrapper Class

Hemant Gupt
Greenhorn

Joined: May 12, 2008
Posts: 26
Source : Marcus Green

Question 25)

What will happen if you attempt to compile and run the following code?

Integer ten=new Integer(10);Long nine=new Long (9);System.out.println(ten + nine);int i=1;System.out.println(i + ten);
1) 19 followed by 20
2) 19 followed by 11
3) Compile time error
4) 10 followed by 1

What would be the right choice ?
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Did you try to run it ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
 
subject: Wrapper Class