How to Get Size, Minimum, and Maximum Value of Data Types in Java? Last Updated : 28 Mar, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report The size of a data type is given by (name of datatype).SIZE. The maximum value that it can store is given by (Name of data type).MAX_VALUE. The minimum value that it can store is given by (Name of data type).MIN_VALUE. Always write first word of data type in capital. Example: 1. If you want to print the size of float data type, use Float.SIZE 2. If you want to print the size and value of the Byte use the following code Java // Print size, minimum value and maximum // value of Byte data types in java import java.io.*; class ValuesOfByte { public static void main(String[] args) { System.out.println("Byte\t" + Byte.SIZE + "\t" + Byte.MIN_VALUE + "\t" + Byte.MAX_VALUE); } } OutputByte 8 -128 1273. To print the size, the maximum and minimum value of all primitive data type use the following code Java // Print size, minimum value and // maximum value of data types in java public class RangeOfDataTypes { public static void main(String args[]) { System.out.println( "S.No.\t Data Type\t Size\t Min. Value\t\t Max. Value\t"); System.out.println("1\t Byte\t\t" + Byte.SIZE + "\t" + Byte.MIN_VALUE + "\t\t\t" + Byte.MAX_VALUE); System.out.println("2\t Short\t\t" + Short.SIZE + "\t" + Short.MIN_VALUE + "\t\t\t" + Short.MAX_VALUE); System.out.println("3\t Integer\t" + Integer.SIZE + "\t" + Integer.MIN_VALUE + "\t\t" + Integer.MAX_VALUE); System.out.println("4\t Float\t\t" + Float.SIZE + "\t" + Float.MIN_VALUE + "\t\t\t" + Float.MAX_VALUE); System.out.println("5\t Long\t\t" + Long.SIZE + "\t" + Long.MIN_VALUE + "\t" + Long.MAX_VALUE); System.out.println("6\t Double\t" + Double.SIZE + "\t" + Double.MIN_VALUE + "\t\t" + Short.MAX_VALUE); System.out.println("7\t Character\t" + Character.SIZE); } } Output: S.No. Data Type Size Min. Value Max. Value 1 Byte 8 -128 127 2 Short 16 -32768 32767 3 Integer 32 -2147483648 2147483647 4 Float 32 1.4E-45 3.4028235E38 5 Long 64 -9223372036854775808 9223372036854775807 6 Double 64 4.9E-324 1.7976931348623157E308 7 Character 16 Java Program to Find Size of int, float, double and char in your system Comment More infoAdvertise with us Next Article Finding the Minimum or Maximum Value in Java ArrayList M messagepriyanshu Follow Improve Article Tags : Java Java Programs Java-Data Types Practice Tags : Java Similar Reads Finding the Minimum or Maximum Value in Java ArrayList The minimum value is the one with the smallest value and the maximum value is the one with the largest value. The main task here is to find the minimum and maximum value from the ArrayList. Consider an example of an ArrayList, and we need to find the largest and the smallest element. Example: Input 5 min read Default Values Assigned to Primitive Data Types in Java In Java, when a variable is declared but not initialized, it is assigned a default value based on its data type. The default values for the primitive data types in Java are as follows:byte: 0short: 0int: 0long: 0Lfloat: 0.0fdouble: 0.0dchar: '\u0000' (null character)boolean: falseNote: It is importa 3 min read How to Find the Minimum or Maximum Element from the Vector in Java? The Collection is a framework offered by Java that provides an architecture to store a group of objects. One such collection is Vector(). There are many ways through which we can find the minimum and maximum elements in a Vector. These methods have been discussed below: Methods: Using Collection.min 3 min read Java Program to Set Minimum and Maximum Heap Size The Heap area is one of the various memory areas present inside the JVM. Â For every JVM one heap area is available. The Heap area will be created at the time of the JVM startup. Objects and the corresponding instance variable will be stored in the heap area. Every array in java is the object only, h 4 min read Determine the Upper Bound of a Two Dimensional Array in Java Multidimensional arrays in Java are common and can be termed as an array of arrays. Data in a two-dimensional array in Java is stored in 2D tabular form. A two-dimensional array is the simplest form of a multidimensional array. A two-dimensional array can be seen as an array of the one-dimensional a 3 min read Java Program For Arithmetic Operations Between BigDecimal and Primitive Data Types The floating-point data types (float and double) are not as accurate to be used in the financial calculations. Therefore, Java offers a separate class "BigDecimal" to perform the operations and avoid the minimal chances of mistakes in calculations. BigDecimal class provides operations on double numb 6 min read Like