What are inner and anonymous class?

Answer Posted / sathya


Inner classes as name suggests, can be declared within a
class, as for that matter, with in a for statement too... or
with in a method of another class.

Anonymous classes are also inner classes but without a name,

The advantage being more abstraction of code, but more
confusing to beginners

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are annotations in java?

826


Define nashorn in java8.

770


What is class array in java?

699


Can we able to pass objects as an arguments in java?

759


Explain wait(), notify() and notifyall() methods of object class ?

793


Why do we need wrapper classes?

782


What are basic keywords?

773


What are white spaces in java?

722


Is java 9 released?

718


Can a private method be declared as static?

767


What are the three parts of a lambda expression?

726


Why is an interface be able to extend more than one interface but a class can’t extend more than one class?

914


What does s mean in regex?

723


Differentiate jar and war files?

768


Can a static class implement an interface?

786