• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

valueof

 
Karu Raj
Ranch Hand
Posts: 481
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Please explain me what is valueof and longvalue

do give me example ???
also let me when it shows compile error when using above methods
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked the API documentation for Long?

Have you experimented with your own code?

After doing this, what are your questions?
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi kartik.....here is my hot tip which will help u remember the methods

method name converts to

xxxValue() W P
parseXxxx() S P
valueOf() S W

so the valueOf() method converts a String primitive into a corresponding wrapper

always keep in mind this little 'customized table' of mine

let me know if it helps
niranjan
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
heyyyy wait

in above table....

W stands for Wrapper
S stands for a String primitive ( like "1" etc)
P stands for a bare primitive ( like 1,2.0 etc)
 
Karu Raj
Ranch Hand
Posts: 481
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats really great

Wonderfull tips

thanks a lot
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic