From 3c665489ed75b150d2e96e2289ae41a05208f777 Mon Sep 17 00:00:00 2001 From: Aadit Agrawal Date: Sat, 14 Sep 2024 01:54:08 +0530 Subject: [PATCH] Add OOP/Java/Lab/Week7/MIT.java --- OOP/Java/Lab/Week7/MIT.java | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 OOP/Java/Lab/Week7/MIT.java diff --git a/OOP/Java/Lab/Week7/MIT.java b/OOP/Java/Lab/Week7/MIT.java new file mode 100644 index 0000000..91beac5 --- /dev/null +++ b/OOP/Java/Lab/Week7/MIT.java @@ -0,0 +1,28 @@ +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(); + } +}