In java programming, there are two data types
- Primitive data type
- Non-primitive type
Primitive Data Types
Primitive data type are those which can store only one value and never allow us to store multiple value of same data type.
(boolean, char, byte, short, int, long, float and double)
Non-Primitive Types
Non Primitive Types are those which can store multiple value and allow us to store multiple value of different type.
(Classes, Interfaces, and Arrays)
==============================
Example for Primitive Data Types
1) Integer Data Type
int a= 5 ;
System.Out.Println(a);
2) Float Data Type
Float a=5;
System.Out.Println(a);
3) Character data type
char = “A”
System.Out.println(a);
=============================
Examples for Non-Primitive Types
1) Classes
2) Array
3) Interfaces
No comments:
Post a Comment