WAP to illustrate the use of interface

Answers were Sorted based on User's Feedback



WAP to illustrate the use of interface..

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

WAP to illustrate the use of interface..

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

Post New Answer

More Core Java Interview Questions

Can a class be protected in java?

0 Answers  


What is a jagged array in java?

0 Answers  


Which are thin and thicK wrapper Class's in Java?

1 Answers  


What is exception hierarchy in java?

0 Answers  


How do you calculate roots in java?

0 Answers  






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?

0 Answers   Bravura Solutions,


How many types of memory areas are allocated by JVM in java?

0 Answers   UGC Corporation,


Are variables stored in ram?

0 Answers  


What is the use of StringTokenizer class?

0 Answers   Hexaware, Virtusa,


What is the current version of java?

0 Answers  


make a method which any number and any type of argument and print sum of that arguments.....

0 Answers  


What is lazy programming?

0 Answers  


Categories