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 |
Why should we use singleton pattern instead of static class?
Can we override static methods?
18 Answers Bally Technologies,
List primitive java types?
What are listeners in java and explain ?
What is a java object and java application?
Which oo concept is achieved by using overloading and overriding?
What is local declaration?
where final and static variable stored?
A person says that he compiled a java class successfully without even having a main method in it? Is it possible?
Why does java not support operator overloading?
what is multitherading
Differentiate between a class and an object.