File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes How to predict the output for this type of Qs? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to predict the output for this type of Qs?" Watch "How to predict the output for this type of Qs?" New topic
Author

How to predict the output for this type of Qs?

Padmalatha Kontham
Greenhorn

Joined: Jun 21, 2007
Posts: 6
class JJF3 {
public static void main(String args[]) {
System.out.print(Integer.toBinaryString(Byte.MAX_VALUE)+",");
System.out.print(Integer.toOctalString(Byte.MAX_VALUE)+",");
System.out.print(Integer.toString(Byte.MAX_VALUE)+",");
System.out.print(Integer.toHexString(Byte.MAX_VALUE));
}
}

What is the output for this Q?
How to calculate the output for this type of Qs?

Regards,
Latha.K.P
Pradeep Kadambar
Ranch Hand

Joined: Oct 18, 2004
Posts: 148
Hey Latha,

Put the same code in your eclipse (any IDE) and check the outputs. You can experiment with your code snippets. This will help you rather than the easy volleys thrown by ranchers.

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40034
    
  28
I would have preferred to see leading zeroes in the "binary" output, however.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to predict the output for this type of Qs?