P4.1:Simple Object Concept for accepting and displaying the information
class Student
{
int id;
String name;
}
class TestStudent
{
public static void main(String args[])
{
Student s1=new Student();
s1.id=100;
s1.name="ABCD";
System.out.println(s1.id+" "+s1.name);
}
}
Comments
Post a Comment