Object Creation In Java

class Student{
int id;
String name;
public static void main(String args[]){
Student s1=new Student();
System.out.println(s1.id);//accessing member through reference variable
System.out.println(s1.name);
}
}

Post a Comment

0 Comments