What is the use of anonymous inner classes ?

Answer Posted / jubin thomas, bhilai(mpccet)

Anonymous class is a class which has no methods defined in
it.
Eg.
class a
{
public void hello();
}
class b
{
a obj = new a();
public void hello()
{
System.out.println("Hello World");
}
}

Is This Answer Correct ?    2 Yes 64 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many bits is size_t?

540


What function extracts specified characters from a string?

558


What is the r character?

582


Which command from the jdk compiles a java program?

479


Are arrays dynamic in java?

528






What is polymorphism in java? What are the kinds of polymorphism?

569


Explain aggregation in java?

543


Explain the init method?

537


What is set and get methods in java?

533


What is hash code collision?

580


What is the difference between procedural and object-oriented programs?

520


Does a class inherit the constructors of its superclass in java programming?

518


What are streams in java 8?

545


What is object-oriented paradigm?

606


What are the library functions in java?

542