Results 1 to 6 of 6
- 07-15-2011, 07:52 PM #1
Member
- Join Date
- Jul 2011
- Posts
- 7
- Rep Power
- 0
Need some help understanding Parsing
i have this particular code
public class Numbers{
public static void main(String args[]){
Integer x =Integer.valueOf(9);
Double c = Double.valueOf(5);
Float a = Float.valueOf("80");
System.out.println(x);
System.out.println(c);
System.out.println(a);
System.out.println(b);
}
}
after execution it gives the outputs
9
5.0
80.0
1092
Could anyone explain how "1092" comes up after execution of "Integer b = Integer.valueOf( "444",16);" how does it parse the argument "444" ?
Thank you.
- 07-15-2011, 07:56 PM #2
Senior Member
- Join Date
- Nov 2010
- Posts
- 210
- Rep Power
- 3
You specified the radix as 16. Since hexadecimal 444 is equal to decimal 1092, that's what it displays.
- 07-15-2011, 08:03 PM #3
Member
- Join Date
- Jul 2011
- Posts
- 7
- Rep Power
- 0
Thank you. that is understood..but radix could be any number.. let say radix=20..will it affect the output ?
- 07-15-2011, 08:07 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,386
- Blog Entries
- 7
- Rep Power
- 17
- 07-15-2011, 08:11 PM #5
Member
- Join Date
- Jul 2011
- Posts
- 7
- Rep Power
- 0
Thank you...
- 07-15-2011, 08:43 PM #6
Similar Threads
-
Need some understanding and help!
By Kevinius in forum New To JavaReplies: 8Last Post: 05-14-2011, 05:50 AM -
Help with understanding Threads
By samp in forum Java AppletsReplies: 2Last Post: 03-09-2011, 06:46 PM -
Understanding this recursion
By Yakg in forum New To JavaReplies: 6Last Post: 01-05-2011, 09:39 PM -
need help in understanding collection
By ShinTec in forum Advanced JavaReplies: 2Last Post: 04-24-2010, 02:49 AM -
Help on understanding a program
By newbie225 in forum New To JavaReplies: 1Last Post: 11-10-2009, 12:53 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks