Answer Posted / swapnil bhosale
hey you all my friends ,we can not extends interface ,we can only implements it,is it true we can implement more than one
interface ,but can not extends it (not single not more)
run the following code so you could understand difference between extends and implements keyword
//code using extends keyword
import java.io.*;
interface A{}
interface X{}
interface Y{}
class ExDemo extends A,X,Y
{
public static void main(String arg[])
{
int a;
System.out.println("hey it works");
}
}
//code using implements keyword
import java.io.*;
interface A{}
interface X{}
interface Y{}
class ExDemo implements A,X,Y
{
public static void main(String arg[])
{
int a;
System.out.println("hey it works");
}
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
How are destructors defined in java?
What is equals method in java?
What is a list in java?
How do you read and print a string in java?
What is ‘is-a ‘ relationship in java?
What is the use of optional ?
Explain the difference between abstract class and interface in java?
What does method mean?
Explain java coding standards for variables ?
How many return statement are allowed in a function?
What are desktop procedures?
How do you achieve singleton?
What is the largest number a double can hold?
What do you mean by synchronized non access modifier?
What are the various access specifiers in java?