Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Write a program to display the maximum and minimum values of Java integer and floating-point data
Write a program to display the maximum and minimum values of Java integer and floating-point data
The maximum and minimum values of integers in java are as follows:

Public class MainClass {

Public static void main(String[] arg) {

//Output the maximum value of an integer.

System.out.println (integer. MAX _ VALUE);

//output integer minimum value

System.out.println (integer. Minimum value);

}

}

Output result: 2147483647-2147483648.

The maximum and minimum values of floating-point type in java;

Public class printing {

Public static void main (strinargs []) {

System.out.println ("The maximum value of floating point number is" +Float. MAX _ VALUE);

System.out.println ("The minimum floating point number is" +Float. MAX _ VALUE);

}

}

Output result: (2-2 (-23)) 2127 2-149