File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Wrapper Class" Watch "Wrapper Class" New topic

Wrapper Class

Hemant Gupt

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

Joined: Feb 24, 2006
Posts: 6657

Did you try to run it ?

SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
I agree. Here's the link:
subject: Wrapper Class
Similar Threads
Wrapper Question
Qn on Wrapper classes.
Wrapper class
Marcus Green Exam 1 Question 25
Marcus Green Q25