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
Can we use String with switch case?
What is the difference between static and non-static variables in java programming?
What is namespace in java?
what is abstract class in Java?
What is floating data type?
What is instance example?
Is java free for commercial?
What are register variables what are the advantages?
What do you mean by append?
How dead lock situation occurs in java and how you can identify it?
Can you explain inner class.
What is prefix of a string?
Can we have return statement in finally clause? What will happen?
Explain about abstract classes in java?
What are the differences between heap and stack memory?