can you create interface instance ?
Answer Posted / saroj singh
we can create instance of Interface like..
interface Imployee
{
void Pay();
void Salary();
}
class SeniorSoftEngg : Imployee
{
public void Pay()
{
Console.WriteLine("Inside Pay");
}
public void Salary()
{
Console.WriteLine("Inside Pay");
}
}
class Program
{
static void Main(string[] args)
{
Imployee Emp = new SeniorSoftEngg();
Emp.Pay();
Emp.Salary();
}
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What does business logic mean?
What is the difference between abstraction and encapsulation?
Is null in java?
What is the difference between final, finally and finalize() in java?
Can a set contain duplicates?
what are the high-level thread states? : Java thread
Hi.... I applied for the post of scientific officer/Engineer-SB(Programmer).Please post the syllabus and sample papers.
Explain importance of inheritance in java?
What is the relationship difference the canvas class and the graphics class?
What is the synonym of framework?
What is broken and continue statement?
What does sizeof return?
what is the role of xml in core java?? and how we can use it?? can somebody give a sample program with explanation and from where i can read more about xml?????
What is meant by the value of a variable?
What is nextline method in java?