We generally use anonymous object when there is just a one time use of a particular object but in case of a repeated use we generally used named objects and use that named reference to use that objects again and again.
Named
– String s = “hello”; System.out.println(s);
– “hello” has a named reference s.
Anonymous
– System.out.println(“hello”);
0 Comments
Please add nice comments or answer ....