Aspire Java Novice to Javanista Java Novice to Javanista Track 2: Java Apprentice
Anonymous classes in Java allow you to define code that use-and-throw. These are classes where you define and instantiate a class simultaneously and which are anonymous, i.e., do not have a name.
These are perfect in scenarios where you want a class that implements a certain interface but will not be reused beyond where it is defined and accessed.
Through this course, learn to create and use anonymous classes, recognizing how they are nested, inner, and unnamed classes that either implement an interface or derive from a base class. As you advance, explore some common use cases for anonymous classes.
When you're finished with this course, you'll be able to create and use anonymous classes in Java correctly, with the correct syntax, and for the proper use case.
These are perfect in scenarios where you want a class that implements a certain interface but will not be reused beyond where it is defined and accessed.
Through this course, learn to create and use anonymous classes, recognizing how they are nested, inner, and unnamed classes that either implement an interface or derive from a base class. As you advance, explore some common use cases for anonymous classes.
When you're finished with this course, you'll be able to create and use anonymous classes in Java correctly, with the correct syntax, and for the proper use case.
Objectives |
---|
Classes in Java: Creating & Using Anonymous Classes
|