How a class can implement an interface?
Answers were Sorted based on User's Feedback
Answer / asrinivas rao
In java a class can implement interface using "implemnts"
keyword.the methods defined in the interface need to be
implemented in the class which implments the respective
interface,otherwise the class becomes has an Abstract class.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / ranganathkini
A class can implement an interface by using the "implements"
clause followed by a list of interface names that it
implements. Then the class needs to implement the
interface's methods within its class body.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / 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 |
Name container classes in java programming?
What is size () in java?
How does finally block differ from finalize() method?
What are the disadvantages of object oriented programming?
what is the purpose of class "Object" which is base class for all classes?
What is boolean logic?
What is light weight component?
Can we override private methods?
What is temp in java?
Can classes declared using the abstract keyword cab be instantiated?
Can you pass by reference in java?
What variables are stored in stack?