wood burning stoves*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes regarding method in wrapper class... 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 "regarding method in wrapper class..." Watch "regarding method in wrapper class..." New topic
Author

regarding method in wrapper class...

Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
source: http://www.geocities.com/sahirshah/applets/mocktest.html



the answre is:11

caqn anybody explain how output is 11?


SCJP5 and SCWCD1.5
Think Twice Act Wise...
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9305
    
  17

Well at statement 1, you pass the method Byte.parseByte the values

Byte.parseByte("b",16);


So it will parse b with base 16 i.e. hexadecimal value. So the hexadecimal value of b is 11. This is why the output is 11...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
Consider Paul's rocket mass heater.
 
subject: regarding method in wrapper class...