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 is the difference between serial and throughput garbage collector?
Where is stringbuffer stored?
Explain about assignment statement?
What is an example of a conditional statement?
Can size_t be negative?
What is difference between array and vector?
What is string literal in java?
What is treemap in java?
What are the difference between composition and inheritance in java?
For class CFoo { }; what default methods will the compiler generate for you>?
What makes a function well defined?
Is the milky way in a void?
What is core java used for?
Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?
What are different types of multitasking?