Anonymous Inner Classes
Having dealt with inner classes in earlier posts this post deals with anonymous inner classes – an even more different type of code that causes more confusion for the amateur programmer. What are anonymous inner classes? ‘Anonymous inner classes’ or ‘Anonymous classes’ as the name suggests is creating an inner class with no name. Here is a simple program that illustrates the working of the anonymous class. Program 1: //Program to illustrate anonymous inner class package whizlabs; class anon_1 { public static void main(String args[]){ pgm p1=new pgm(); pgm p=new pgm(){ // start of […]
Anonymous Inner Classes Read More »