MIT-Curricular/OOP/Java/Lab/Week7/MIT.java

29 lines
684 B
Java

class MIT {
class Student_Detail {
String name;
int id;
String college_name;
Student_Detail(String name, int id) {
this.name = name;
this.id = id;
this.college_name = "MIT";
}
void display_details() {
System.out.println("Name: " + name);
System.out.println("ID: " + id);
System.out.println("College: " + college_name);
}
}
public static void main(String[] args) {
MIT mit = new MIT();
MIT.Student_Detail student =
mit.new Student_Detail("Sherlock Holmes", 230953344);
student.display_details();
}
}