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 |
How a variable is stored in memory?
Why is it called a string?
Program to find greatest prime number in n numbers?
What is skeleton and stub? What is the purpose of those?
How can we make a class virtual?
Are variables stored in ram?
What is string [] args?
Write a program to reverse a number in java?
Can we define static methods inside interface?
what invokes a threads run() method? : Java thread
What is parsing in java?
Explain method local inner classes ?