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
Are primitives objects?
What is a get method?
What do you mean by stream pipelining in java 8?
Why do we need variables?
How to compare strings in java?
Why do we need data structure in java?
How do you check if a string contains only numeric digits?
How to sort a collection of custom Objects in Java?
Is null or empty java?
What is the default size of load factor in hashing based collection?
Can static method access instance variables ?
What is the use of join method?
Can a static class have a constructor?
Explain jvm, jre, and jdk?
Which programming language is most secure?