Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regarding method in wrapper class...

 
Ganeshkumar cheekati
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
source: http://www.geocities.com/sahirshah/applets/mocktest.html



the answre is:11

caqn anybody explain how output is 11?
 
Ankit Garg
Sheriff
Posts: 9528
32
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic