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 do you ensure that n threads can access n resources without deadlock?
How do you convert int to char in java?
Is an object null?
What are some characteristics of interference class?
What is nested class?
Can we override data members in java?
what is the messsage u r going to get from an objectoriented programing?
What is classes in java?
Where are the card layouts used?
What is the final keyword in java?
What is file in java?
What are the steps involved to create a bean?
Given a singly linked list, determine whether it contains a loop or not without using temporary space?
What is collection class in java?
Why is string buffer better than string ?