Java helps us creating anonymous object using
new class_name();
statement and calling the methods using association(.) operator like
new Emp().input();
How can I use it to invoke two methods simultaneously from an anonymous object like invoking both input() and show() together ?
Emp e = new Emp(); e.input(); e.show();. Why is that not an acceptable solution, btw?anonymousif you assign it to a name ;)why do you need the object to be anonymous?