The data types was divided into two types they are:
1.Primitive Datatypes
2.Non-Primitive Datatypes
Primitive Datatypes:
- byte
- short
- int
- float
- double
- boolean
- char
Non-Primitive Datatypes:
- string
- arrays
- classes
public class Main {
public static void main(String[] args) {
int myNum = 8;
float myFloatNum = 7.5f;
char myLetter = 'D';
boolean myBool = false;
String myText = "RAGULTECHNOLOGY";
System.out.println(myNum);
System.out.println(myFloatNum);
System.out.println(myLetter);
System.out.println(myBool);
System.out.println(myText);
}
}
This was the simple program to show the types of datatypes in java programing .
إرسال تعليق