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
If try block is successfully executed, Then Is Finally block executed?
Explain about serializable interface in java?
What is r * in math?
Explain wait(), notify() and notifyall() methods of object class ?
What is use of functional interface in java 8? Explain
What are void methods?
What is cr keyboard?
What is the difference between form & report?
How many characters is 16 bytes?
What does system out println () do?
What is garbage collection? What is the process that is responsible for doing that in java?
What is java dot?
Why do we need array in java?
Can a class have multiple constructors?
How do you create a sop?