Can you extend more than one interface?

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


Please Help Members By Posting Answers For Below Questions

Can we use String with switch case?

657


What is the difference between static and non-static variables in java programming?

511


What is namespace in java?

534


what is abstract class in Java?

643


What is floating data type?

529






What is instance example?

513


Is java free for commercial?

486


What are register variables what are the advantages?

441


What do you mean by append?

524


How dead lock situation occurs in java and how you can identify it?

534


Can you explain inner class.

584


What is prefix of a string?

560


Can we have return statement in finally clause? What will happen?

506


Explain about abstract classes in java?

576


What are the differences between heap and stack memory?

539