17 October, 2020

write a java program to describe instance variable.

instance variable,java tutorial,java instance variable,instance variables,instance variable in java,java programming,java variables,java tutorial for beginners,instance variable in java program,learn java programming,java (programming language),local variable in java,how to declare instance variable in java,learn java,learn programming in java,instance variable vs local variable,java instance variables,instance variables java,java variables tutorial,java - instance variables
class test
{
	int roll_no; //instance_variable
}
class instance_variable
{
	public static void main(String a[])
	{
		test obj1= new test(); //create object of test class 
		test obj2= new test();
		obj1.roll_no=10;
		obj2.roll_no=20;
		System.out.println("roll_no of object1="+obj1.roll_no);
		System.out.println("roll_no of object2="+obj2.roll_no);
	}
}
30
This Is The Newest Post
PREVIOUS ARTICLE Previous Post
This Is The Newest Post
PREVIOUS ARTICLE Previous Post