diff --git a/Java/practice/AnonymousObject.class b/Java/practice/AnonymousObject.class new file mode 100644 index 0000000..69acbb2 Binary files /dev/null and b/Java/practice/AnonymousObject.class differ diff --git a/Java/practice/AnonymousObject.java b/Java/practice/AnonymousObject.java new file mode 100644 index 0000000..5eada87 --- /dev/null +++ b/Java/practice/AnonymousObject.java @@ -0,0 +1,23 @@ +class Person { + String name; + int age; + + Person(String name, int age) + { + this.name = name; + this.age = age; + } + + void display() + { + System.out.println("Name: " + name + + ", Age: " + age); + } +} + +public class AnonymousObject { + public static void main(String[] args) + { + new Person("John", 30).display(); + } +} diff --git a/Java/practice/Person.class b/Java/practice/Person.class new file mode 100644 index 0000000..436933c Binary files /dev/null and b/Java/practice/Person.class differ