Data types in JAVA
Data types in Java: easy ICSE Class 10 Computer Science notes with Java examples for students.
Data types
It is a format that any variable is able to store.
In java there are two types of data types.
Primitive and Non primitive.
Primitive data types:-
The fundamental datatypes that are integral part of the java are called primitive data types.
These are given to the user by the java compiler. All the primitive data types have a fixed size. Whenever programmer creates a variable using the primitive data types that particular no. Of bytes are reserved in memory.
They are ready to use data types.
The user can make an instance of the data type and use it to store a particular type of data.
There are 8 primitive data types and theirs sizes(the no of bytes they reserve in the memory)
int size 4 bytes
float 4 byes
long 8 bytes
double 8 bytes
char 2 bytes byte 1 byte boolean 1 bit short. 2 bytes
Non primitive data types:-
These are called user defined data types also, because they are created with the help of primitive data types by the user.
The size is not fixed.
Array, class and interface are examples of non primitive data types.
Related Posts
Continue learning with these related articles

ISC Practical 2027: College Enrolment Code Validator and Stream Report – Algorithm and Java Program
Fully solved ISC Computer Science Practical 2027 question: validate college enrolment codes made of a stream, year and serial number, give the exact reason for each rejection, auto-correct lowercase streams and prepare a stream-wise report.

ISC Practical 2027: Digital Lock Security Code Analyzer – Algorithm and Java Program
Fully solved ISC Computer Science Practical 2027 number-logic question: for a 5 to 10 digit security code, find the first and last digits, odd and even position sums, product of non-zero digits, digit frequency and classify the code as STRONG, MODERATE or WEAK.

String Methods in Java for ICSE Class 10: 25 Output Questions with Answers
ICSE Class 10 Computer Applications practice on String class methods: length, charAt, indexOf, lastIndexOf, substring, replace, trim, compareTo, equals and more, with 25 board-style output questions and step-by-step answers.