Java data types define the type and value range of the data for the different types of variables , constants, method parameters, return types, etc. The data type tells the compiler about the type of data to be stored and the required memory. To store and manipulate different types of data, all variables must have specified data types. Based on the data type of a variable, the operating system allocates memory and decides what can be stored in the reserved memory. Therefore, by assigning different data types to variables, you can store integers, decimals, or characters in these variables. The Java data types are categorized into two main categories − Primitive Data Types Reference/Object Data Types Java Primitive Data Types Primitive data types are predefined by the language and named by a keyword. There are eight primitive data types supported by Java. Below is the list of the primitive data types: byte short int long float double boolean byte Data Type The...
Comments
Post a Comment