Anonymous Object in JAVA
class A {
int k;
A(int m) {
k=m;
}
int getK() {
return k;
}
}
class TestDemo {
public static void main(String s[]) {
System.out.println(new A(10).getK());
}
}
Watch Following Video to Learn in Detail :
GTU, 3140705, OOP ,Learn Object Oriented Language Programming, OOPJ Learners of JAVA. Inheritance, Final, Static, File Handling, package, MultiThreading, Object Class, AWT, Frame, Exception Handling, Abstract Class, Interface, JVM, Collection Framework