Types of Data types in java programing

 

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

Example:

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 .

0 تعليقات

إرسال تعليق

Post a Comment (0)

أحدث أقدم