gudii9
asked on
bit conversion
public class BinDec{
public static void main(String argv[]){
System.out.println(Integer .parseInt( "11",2));
System.out.println(Integer .toString( 64,2));
}
}
I ran above program from link
http://www.jchq.net/certkey/0503certkey.htm
got output like
3
1000000
I did not understand how I got this output.
Any ideas, resources,sample code,links, highly appreciated. thanks in advance.
public static void main(String argv[]){
System.out.println(Integer
System.out.println(Integer
}
}
I ran above program from link
http://www.jchq.net/certkey/0503certkey.htm
got output like
3
1000000
I did not understand how I got this output.
Any ideas, resources,sample code,links, highly appreciated. thanks in advance.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
>>>In the first case you parse integer written as 11 in binary system.
11 in binary system is 3
In toString(64,2) case it in fact says present number 64 in binary system
why there is " " for 11 where as not present for 64.
where it says present number 64 in binary system. please advise
11 in binary system is 3
In toString(64,2) case it in fact says present number 64 in binary system
why there is " " for 11 where as not present for 64.
where it says present number 64 in binary system. please advise
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
11 in binary system is 3
In toString(64,2) case it in fact says present number 64 in binary system
and that would be 1000000
So the output looks quite understandable