|
A program to print limits of the primitive types |
|
|
This Java program prints the limits of primitive types (e.g. byte, short, int ...) in Java:
public class PrintLimits
{
public PrintLimits()
{
}
public static void main(String args[]) {
System.out.println("Min byte value = " + Byte.MIN_VALUE);
System.out.println("Max byte value = " + Byte.MAX_VALUE);
System.out.println("Min short value = " + Short.MIN_VALUE);
System.out.println("Max short value = " + Short.MAX_VALUE);
System.out.println("Min int value = " + Integer.MIN_VALUE);
System.out.println("Max int value = " + Integer.MAX_VALUE);
System.out.println("Min float value = " + Float.MIN_VALUE);
System.out.println("Max float value = " + Float.MAX_VALUE);
System.out.println("Min double value = " + Double.MIN_VALUE);
System.out.println("Max double value = " + Double.MAX_VALUE);
}
}
|
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.