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

What is the method in java?

609


What things should be kept in mind while creating your own exceptions in java?

638


What is java command?

574


What is method and methodology?

614


When a byte datatype is used?

575






How do you declare an array in java?

530


Can we use a default constructor of a class even if an explicit constructor is defined?

660


How does thread synchronization occurs inside a monitor?

563


Do we need to manually write Copy Constructor?

614


Can we override private constructor in java?

519


What is use of map in java?

523


What is the difference between heap memory and stack memory?

626


How do you start a new line in java?

529


How to convert string to byte array and vice versa?

596


Do you know how to reverse string in java?

593