Data Types Maximum and Minimum Values
1. Go to the API:
http://docs.oracle.com/javase/8/docs/api/
Select the java.lang package to see the “wrapper” classes for each of the primitive data types. The classes contain
constants that store the maximum and minimums of each primitive data type.
2. Write a program that outputs the following primitive data type maximum and minimum values, using the template
below. Use the first code template as your example for completing the remaining templates. Make use of Eclipse’s
“intellisense (auto complete)” feature to help you complete the constants for the classes. After each template, run
the program, and record the output showing the data type’s max and min values.
/**
* Program Name: DataTypesMaxMin.java
* Purpose: To print the maximum and minimum values of the range
* of a data type
* Coder: Your Name Here, Student Number
* Date: September, 2018
*/
public class DataTypesMaxMin
{
public static void main(String[] args)
{
//Maximum and minimum value of a byte data type
byte byteMax = Byte.MAX_VALUE;
byte byteMin = Byte.MIN_VALUE;
System.out.println("Max value of a byte: " + byteMax);
System.out.println("Min value of a byte: " + byteMin);
System.out.println();
//Maximum and minimum value of a short data type
//Maximum and minimum value of an int data type
//Maximum and minimum value of a long data type
//Maximum and minimum value of a float data type
//Maximum and minimum value of a double data type
//Maximum and minimum value of a char data type
}//End of main method
}//End of class