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

How do you ensure that n threads can access n resources without deadlock?

795


How do you convert int to char in java?

562


Is an object null?

542


What are some characteristics of interference class?

502


What is nested class?

553






Can we override data members in java?

606


what is the messsage u r going to get from an objectoriented programing?

1592


What is classes in java?

504


Where are the card layouts used?

597


What is the final keyword in java?

541


What is file in java?

543


What are the steps involved to create a bean?

670


Given a singly linked list, determine whether it contains a loop or not without using temporary space?

568


What is collection class in java?

529


Why is string buffer better than string ?

582