What is constructor and anonymous inner class instance?

In simple words, a nameless inner class is called anonymous inner class. Java anonymous inner classes are useful when we need only one object of the class. Since an anonymous inner class does not have a name, it cannot have a constructor because we know that a constructor name is the same as the class name.

Sizin İçin Seçtik  What is the difference between inner class and nested class?

Leave a Reply

Your email address will not be published. Required fields are marked *