1/*
2 Java Data Types
3There 2 Types Of Data Types In Java
41) Primitive -> byte, char, short, int, long, float, double and boolean.
52) Non-primitive -> (All Classes) -> String, Arrays etc.
6
7Type Size Stores
8byte 1 byte whole numbers from -128 to 127
9short 2 bytes "" -32,768 to 32,767
10int 4 bytes "" -2,147,483,648 to 2,147,483,647
11long 8 bytes ""-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
12float 4 bytes fractional numbers; for storing 6 to 7 decimal digits
13double 8 bytes fractional numbers; "" 15 ""
14boolean 1 bit true or false values
15char 2 bytes single character/letter or ASCII values
16*/
1Primitive data types are those data types which are used by programmers when creating variables in their program.
2For example :-
3 * boolean
4 * char
5 * byte
6 * short
7 * int
8 * long
9 * float
10 * double
11Non-Primitive data types:
12 * String
13 * array
14 * enum
15 * class
16 * etc
1Primitive types are the most basic data types available within the Java language. There are 8: boolean , byte , char , short , int , long , float and double . These types serve as the building blocks of data manipulation in Java. Such types serve only one purpose — containing pure, simple values of a kind.
1Non-Primitive Data Types: These data types are not actually defined by
2the programming language but are created by the programmer. They are
3also called “reference variables” or “object references” since they
4refer to a memory location which stores the data.
5
6All classes are non-primitive data types.
7Example : Object, String, Integer, Boolean, etc...
1Primitive types are the most basic data
2types available within the Java language.
3Some of them are boolean , byte , char ,
4short , int , long , float and double .
5These types serve as the building blocks
6of data manipulation in Java.
7