WAP to illustrate the use of interface
Answers were Sorted based on User's Feedback
Answer / nsiddiqui69@yahoo.com
Interface inf1
{
void show();
}
class Derived implement inf1
{
void show1()
{
S.o.p("Derived class method");
}
public void show()
{
S.o.p("Interface method");
}
}
class infdemo
{
p.s.v.m(String args[ ])
{
Derived d1= new Derived();
d1.show();
d1.show1();
}
}
Is This Answer Correct ? | 5 Yes | 1 No |
Answer / siva mukesh
interface inf1
{
void show();
}
class Derived implement inf1
{
void show1()
{
S.o.p("Derived class method");
}
public void show()
{
S.o.p("Interface method");
}
}
class infdemo
{
p.s.v.m(String args[ ])
{
Derived d1= new Derived();
d1.show();
d1.show1();
}
}
Is This Answer Correct ? | 0 Yes | 0 No |
How to prevent to create multiple objects of a java class?
How to convert string to byte array and vice versa?
What are the types of casting?
Is 0 a prime number?
Can we have static methods in an interface?
Explain the difference between jdk, jre, and jvm?
What is Collection interface?
Difference between this(), super()?
12 Answers College School Exams Tests, Oracle,
What is the purpose of a transient variable?
To what value is a variable of the Boolean type automatically initialized?
What is java and why do we need it? Explain
What is flag in java?