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 @before and @beforeclass annotation?
What are data structures in java?
Difference between arraylist and hashset in java?
What is meant by string is immutable?
java Technical questions asked by JPMC
Can a class be defined inside an interface?
How does system arraycopy work in java?
What is the difference between public, private, protected, and friend access?
How to compare two strings in java program?
What are packages in java?
What is the purpose of default constructor?
What are the super most classes for all the streams?
How hashmap increases its size in java?
What are the differences between this and super keyword?
How do I know if java is installed?