• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Wrapper Class

 
Hemant Gupt
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try to run it ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic