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 |
What is a protected class in java?
What are the methods to rectify ambiguities in the interfaces in JAVA?
What is static block?
Why is core java important?
What is immutable state?
How do you identify if jvm is 32-bit or 64-bit from java program?
Why we use set in java?
Why can't we use static class instead of singleton?
What are the two ways in which thread can be created?
Is it safe for adding 10,00,000 records/objects to HashMap?, i.e is it safe to add millions of objects to HashMap?
How can we use primitive data types as objects?
Can we override the private methods?