Menu
Topics Index
...
`

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.

Java Data Types, Data Types In Java, Java data types - data types in Java

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.

Java Integer
The topics that we fully cover in this section are Data Types, Primitive Data Types, Integer Data Types, Floating Point Data Types, Java Character, Literals, Integer Literals, Floating Point Literals, etc which deeply explained below.

In this Java data types section we discuss in detail about :
2.1 Data Types In Java
  • Java is a strongly typed language, which means every data or information has a type Known To Be "Data Type"and that Data Type can not be changed once declared. So every ...Read More

2.2 Primitive Data Types
2.2.1 Primitive Data Types In Java
  • Primitive data types are basic data types supported by Java which can be used to store the information. These data types can be further combined to make more ...Read More

2.2.2 Integer Data Types In Java
  • The Java integer data types are used to store whole numbers like 2, 3, 267, -1245, 0, 8382923 etc. Integers do not contain decimal points, so 3.14 and 4221.76 are not ...Read More

2.2.3 Floating Point Data Types In Java
  • The floating-point data types are used to store decimal numbers like 3.45, -1267.89, 0.33424324, 0.00011, 4.0, 189.0 etc. Java supports two floating point types ...Read More

2.2.4 Java Character
  • A character type (typically called "char") may contain a single letter, digit, punctuation mark, symbol, formatting code, control code, or some other specialized ...Read More

2.2.5 Boolean Data Types In Java
  • Boolean is the primitive data type in Java. There are only two values that a boolean type can take they are: true or false. Boolean type is used when we want to ...Read More

2.2.6 Literals
2.2.6.1 Java Literals
  • A constant value in a program is denoted as literal. e.g., 10, 534, 29.5, 'c', true, false, 'E', '&' are all literals of various datatypes. e.g., int num = 10; In the statement 10 is ...Read More

2.2.6.2 Integer Literals In Java
  • Integer literals are used to initialize integer group datatypes like byte, short, int and long. These literals are nothing but a sequence of digits. If they are suffixed with ...Read More

2.2.6.3 Floating Point Literals In Java
  • Floating Point Literals In Java contains the fractional parts. e.g., 251.73, 3.14, 98766.12, 10E+03, 2.78e-7. If the Floating Point Literal is suffixed with letter F or f, then it is ...Read More

2.2.6.4 Character Literals In Java
  • Character Literals In Java are used for primitive data type char. Character Literals Are included in a single quotation ('ex') marks. Java Character Literals are 16-bit ...Read More

2.2.6.5 String Literal In Java
  • String Literals In Java is a sequence of characters which has to be included between double quotes ("ex") and should occur on a single line. String Literals Double Quotes ...Read More

2.2.6.6 Boolean Literals In Java
  • In Boolean Literals, When we assign a value to a boolean variable, we can only use either true or false. Unlike C, we can't presume that the value of 1 is equivalent to ...Read More

Dependent Topics : 1. Overview Of Java Programming Language 

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App