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
Write a program to print fibonacci series up to count 10.
What is object data type?
Why array is used in java?
What is treemap in java?
Is 64bit faster than 32 bit?
What is Java Reflection API? Why it’s so important to have?
How do you compare arrays in java?
Write a java program to print fibonacci series?
How do you define a method?
What are the application of stack?
Differentiate between class and structure.
Can a method be static?
Write a program to print count of empty strings in java 8?
What is a Transient Object?
What are assembly attributes?