About 107,000 results
Open links in new tab
  1. How are anonymous inner classes used in Java? - Stack Overflow

    Dec 10, 2008 · An inner class is associated with an instance of the outer class and there are two special kinds: Local class and Anonymous class. An anonymous class enables us to declare …

  2. java - Java8 Lambdas vs Anonymous classes - Stack Overflow

    Mar 25, 2014 · An anonymous inner class (AIC) can be used to create a subclass of an abstract class or a concrete class. An AIC can also provide a concrete implementation of an interface, …

  3. java - Anonymous vs named inner classes? - Stack Overflow

    Feb 27, 2016 · If you see a named inner class, someone might think it'd be used in multiple places in the class. They are very similar, so neither point is a game-changer. I just think it …

  4. Java (anonymous or not) inner classes: is it good to use them?

    Feb 18, 2010 · In my view, 90% of inner classes in Java code are either entities that are associated with a single class and were thus "shoved in" as inner classes, or anonymous inner …

  5. java - Accessing constructor of an anonymous class - Stack Overflow

    Dec 12, 2008 · The Java spec only specifies that the anonymous class, which is the offspring of the (optionally) abstract class or implementation of an interface, can not have a constructor by …

  6. java - How to pass parameters to anonymous class ... - Stack …

    However, classes can reference variables from containing scopes. For an anonymous class these can be instance variables from the containing class (es) or local variables that are marked …

  7. java - When exactly is it leak safe to use (anonymous) inner classes ...

    An Anonymous Inner Class is basically a discrete Inner Class. You just don't have to create a whole new definition and simply override the appropriate methods. In all other respects it is a …

  8. Java 8, Lambda : replace Anonymous inner class by lambda

    Java 8, Lambda : replace Anonymous inner class by lambda Asked 11 years, 3 months ago Modified 5 years, 9 months ago Viewed 88k times

  9. java - Why are only final variables accessible in anonymous class ...

    When an anonymous inner class is defined within the body of a method, all variables declared final in the scope of that method are accessible from within the inner class.

  10. What is the Difference between inner class and anonymous inner …

    Sep 10, 2013 · A local inner class consists of a class declared within a method, whereas an anonymous class is declared when an instance is created. So the anonymous class is created …