Header Ads

  • Breaking Now

    Can an anonymous class implement an interface and extend a class at the same time?

    No,an anonymous class can either implement an interface or extend a class at a particular time but not both at the same time.


    1. yes i can be done at the same time for example we do it applet class..we extend an applet class in our custom class and implements an ActionListner interface in same class...!!!

    2. This can be done only when u have a inner class with name....
      not with anonymous class
      if u do it shows the error....


    Post Top Ad

    Post Bottom Ad