How a class can implement an interface?

Answer Posted / mayuri wankhade

without using implements clause it is also possible to use
interface by creating object of an interface in the class
containing main method like :

nameOfInterface Obj = new nameOfInterface()
{
implement a method declared in an interface
};
Obj.MethodName();

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between arraylist and linkedlist in java?

486


Can we define static methods inside interface?

529


How do you sort a list in java?

582


When throws keyword is used?

584


What happens if main method is not static?

499






Difference between string, string builder, and string buffer?

530


What is the synonym of procedure?

532


What is the difference between Error, defect,fault, failure and mistake?

662


Explain the importance of join() method in thread class?

641


What is the purpose of using break in each case of switch statement?

566


What is broken and continue statement?

535


Can each java object keep track of all the threads that want to exclusively access it?

540


What are the different ways of implementing thread? Which one is more advantageous?

539


What is sortedmap interface?

557


Can a source file contain more than one class declaration?

514