Data type in Java

Attribute that tell a computer system what kind of value a variable holds and how to interpret it

In Java datatype is classified in to two types

primitive Datatype
Non primitive (Reference) Datatype

1. primitive Datatype:

1. byte

It is used to s…


This content originally appeared on DEV Community and was authored by SELVAKUMAR R

Attribute that tell a computer system what kind of value a variable holds and how to interpret it

In Java datatype is classified in to two types

  1. primitive Datatype
  2. Non primitive (Reference) Datatype

1. primitive Datatype:

1. byte

It is used to store the small whole number from -128 to 127

2. short
It is used to store the whole number from -32768 to 32767

3. int
It is used to store the whole number from - 2 billion to 2 billion

4.long
It is used to store the whole number 9 quintillion add L at end of the whole number

5. float
It store the decimal number up to 7 digit including the f at end of the decimal number

6. double
It store the decimal number up to 16 digit including the decimal

7. Boolean
It is used to provide the logical value true or false

8. char
It is used to store the single character

2. Non primitive datatype

String -> Used for storing text

Array -> Used to store multiple value in a single variable

Classes -> Used as a blueprint for creating objects


This content originally appeared on DEV Community and was authored by SELVAKUMAR R


Print Share Comment Cite Upload Translate Updates
APA

SELVAKUMAR R | Sciencx (2025-10-30T09:46:41+00:00) Data type in Java. Retrieved from https://www.scien.cx/2025/10/30/data-type-in-java/

MLA
" » Data type in Java." SELVAKUMAR R | Sciencx - Thursday October 30, 2025, https://www.scien.cx/2025/10/30/data-type-in-java/
HARVARD
SELVAKUMAR R | Sciencx Thursday October 30, 2025 » Data type in Java., viewed ,<https://www.scien.cx/2025/10/30/data-type-in-java/>
VANCOUVER
SELVAKUMAR R | Sciencx - » Data type in Java. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/10/30/data-type-in-java/
CHICAGO
" » Data type in Java." SELVAKUMAR R | Sciencx - Accessed . https://www.scien.cx/2025/10/30/data-type-in-java/
IEEE
" » Data type in Java." SELVAKUMAR R | Sciencx [Online]. Available: https://www.scien.cx/2025/10/30/data-type-in-java/. [Accessed: ]
rf:citation
» Data type in Java | SELVAKUMAR R | Sciencx | https://www.scien.cx/2025/10/30/data-type-in-java/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.