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 purpose of return statement?
What is lossy conversion in java?
Is array a class in java?
What are streams?
Explain the polymorphism principle?
What is a final class ?
What is the Scope of Static Variable?
Why singleton class is used in java?
Write an algorithm program in java for the following question.. In a VLSI design techniques,they used rectangles to design circuits. EVery rectangle is to be placed according to x,y coordinates. Check whether or not two rectangles overlap each other. Here overlapping of rectangles is acceptable, if 1) one rectangle intersect with other. 2) one rectangle fully covers other. The time of algorithm should not exceed o(n logn).
What is the format specifier?
What is codebase?
What are the skills required for core java?
Write a program in java to establish a connection between client and server?
Is string pool garbage collected?
Why there is no call by reference in java?