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

How the elements are organized in GridBagLayout?

1 Answers  


When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?

0 Answers  


What is an array length?

0 Answers  


What are scalar data types?

0 Answers  


What is a null class?

0 Answers  






is it possible to instantiate the math class?

0 Answers  


According to java operator precedence, which operator is considered to be with highest precedence?

0 Answers  


What is finally in exception handling?

7 Answers  


What is Distributed Application and what is its usage?

2 Answers  


How do you make an arraylist empty in java?

0 Answers  


What is difference between static method and static variable?

7 Answers  


How do you sort words in java?

0 Answers  


Categories