Refresh Your Java - Before Java Interview
We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....
"An anonymous class is essentially a local class without a name."
As you will see from the sample program in this lesson, anonymous class definitions are often included as arguments to method calls.
Button buttonC = new
Button("C");
buttonC.addMouseListener(new MouseListener()
{//begin class
definition
//Instance initialize
{System.out.println(
"Anonymous class C name:
" +
getClass().getName());}
As is the case for an object of a member class or a local class(an
inner class) (discussed in previous lessons), an object of an
anonymous class must be internally linked to an object of the
enclosing class.
Thus, an anonymous class is truly an inner class, because an object of the anonymous class cannot exist in the absence of an object of the enclosing class.
This Portal is intended to put all Java/J2ee related topics at one single place for quick referance, not only Technical , but also the Project Management Related thing such as Development Process methodoogies build process, unit testing etc.,
This Portal has More than 500 Java Interview Questions (also could be Considered as Quick Notes) very neatly separated topic by topic with simple diagrams which makes you easily understandable. Importantly these are from our Realtime expericance.