Java Data Types | Java Literals:Data type is a special type of keyword which is useful for allocating sufficient memory for that data. In other words, Java Data Types are the classification, to identifying one of various types of data such as real number, integer, floating point or boolean. That determines the possible values for that particular type and the operations that can be done on values of that type.So, Java data types are in various forms to store the different types of information. These Java data types are mainly classified into 2 types.(a) Primitive Data Types and (b) Non-Primitive Data Types . Java data types can not be modified once they declared. The primitive data types in Java are also called as Fundamental data types or Basic data types. In primitive, Java data types are mainly classified into four types. They are Integer Data Types In Java, Floating-Point Data Types In Java, Character Data Types in Java and Boolean Data Types in Java. In Non-Primitive, Java data types are further classified into three types. User defined data type is one of these Non-primitive Java data types. According to the requirement we can choose the appropriate type in Java data types. Java integer data types are broadly classified into four types depending on their size. They are byte, short, int and long. In Java integer data type, the allowed size is calculated depending on number of bytes. The Java integer also contains negative numbers. So, this is the reason, the size is ranging from -128 to +127 in Java integer. Java long has the size of 64 bits or 8 bytes. Distance to sun in kilo meters, hair count, mobile number are the examples come under Java long. In this Java data types section we discuss in detail about : 2.1 Data Types In Java
2.2 Primitive Data Types 2.2.1 Primitive Data Types In Java
2.2.2 Integer Data Types In Java
2.2.3 Floating Point Data Types In Java
2.2.4 Java Character
2.2.5 Boolean Data Types In Java
2.2.6 Literals 2.2.6.1 Java Literals
2.2.6.2 Integer Literals In Java
2.2.6.3 Floating Point Literals In Java
2.2.6.4 Character Literals In Java
2.2.6.5 String Literal In Java
2.2.6.6 Boolean Literals In Java
|