From abbdf81494a25a590f4bafdca8c8e8e48f192da4 Mon Sep 17 00:00:00 2001 From: RAJJIT <2.0lairaj@gmail.com> Date: Fri, 22 Nov 2024 21:35:06 +0530 Subject: [PATCH] java-practice-anonymous-object --- Java/practice/AnonymousObject.class | Bin 0 -> 370 bytes Java/practice/AnonymousObject.java | 23 +++++++++++++++++++++++ Java/practice/Person.class | Bin 0 -> 981 bytes 3 files changed, 23 insertions(+) create mode 100644 Java/practice/AnonymousObject.class create mode 100644 Java/practice/AnonymousObject.java create mode 100644 Java/practice/Person.class diff --git a/Java/practice/AnonymousObject.class b/Java/practice/AnonymousObject.class new file mode 100644 index 0000000000000000000000000000000000000000..69acbb2d69605b15b3f2d01c8cfcaf890edbd74c GIT binary patch literal 370 zcmZWl+e!m55Ixy$n|58h>#9{B6ntwH><1`<6a=NHP+1V4vTdj-yNT>Y=x6z2LBS93 zqr^!;3Yv$RlQT2tWb*a>{s~}!Jr53Q9IlT#8Vun~yoi1(^t6AQ%;dOaXq+jn%5#QV zw-<9XiMf+`VRRE7gL`eBvTQQx(64?!ZhW6^2U7n<`6WelL=g7&jA2TZhO07QL9k8<{E}%S&aOxBlp!*jM2Y z8?>-J4wzk;;wIhpDKpCTqXpP20TQ5S%Rqz{w$UMMTaV!`+28~GA!>yO3#`4Ny&AG# O3L0oHM|KE1*!=;~dqxZZ literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..436933ce1ee9d352048bea9a89f3aa76ebcc7d90 GIT binary patch literal 981 zcmaJ=-EI;=6#fP%3%E$-r?pxuDz!jsslOLuOe#qu3Dzbw^}?$GCUnd04A~u;@Fu>7 zrq!euK7bEpJkxCg1meY5kxJ-Y%C$puzbePdCldrU;ErS z6J5;^f9FU?zh{V+DkN zeLnmo^r`9v2~>#nklOyX$aaeRee=!4v7N#Wo>|y69jY;uCKGYwxf+OCIGC_$2fVA5 zPdR*>&i}?RjP#Mqo-2Y|En66x;*F+3reMT}&eq=oC{Ckd1Y2?_Sdoe`4%fjiX;a=$?O3ah|R n+@G+RcL}7Cqa>o(Bt3$s*rIQOysLD|*rUG`Y0oLC*I4@pqYm=P literal 0 HcmV?d00001