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 |
Can a class be protected in java?
What is a jagged array in java?
Which are thin and thicK wrapper Class's in Java?
What is exception hierarchy in java?
How do you calculate roots in java?
What design pattern you have used in your project? I answered Factory pattern, how it is implemented? What are its advantage? Do know about Abstract Factory?
How many types of memory areas are allocated by JVM in java?
Are variables stored in ram?
What is the use of StringTokenizer class?
What is the current version of java?
make a method which any number and any type of argument and print sum of that arguments.....
What is lazy programming?