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
What is not thread safe?
What is the difference between && and & in java?
What is the impact of declaring a method as final?
What is a for loop in java?
What is the importance of finally block in exception handling?
Will minecraft java be discontinued?
What is JDBC Driver interface?How can you retrieve data from the ResultSet
What is command line argument in java?
Why singleton pattern is better than creating singleton class with static instance?
What is import java util arraylist?
What is a container in a gui?
What is a Null object?
what is object slice?
What are the two ways to create a thread?
How many types of interfaces are there?