Technology News, Online Income, Gadgets, Reviews

Technology News, Gadgets and Reviews

Translate

Breaking

Total Pageviews

Monday, January 16, 2023

Java Variables Are Divided Into Two Category

 Java Variables 

Java Variable Are Divided Into Two Categories:

Primitive Variables: Primitive Variables are those variables which can be used to represent primitive value such type of variable is considered as primitive variables. 

Eg: int x =10 ;

x contain 10

Here x  represents as variables. 

Reference Variables:  Reference Variables are those variables which can be used to represent a Reference  such type of variable is considered as Reference variables. 

Eg: 

Class Student{

String name = "Dileep Kumar";

public static void main (String [] args){

Student s = new Student();

System.out.println(s.name); 

}

   } 

Above (s) is a reference variable. 

New Keyword is used for creating  a new object. 




 

No comments:

Post a Comment