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


Please Help Members By Posting Answers For Below Questions

What is the difference between serial and throughput garbage collector?

569


Where is stringbuffer stored?

543


Explain about assignment statement?

586


What is an example of a conditional statement?

555


Can size_t be negative?

600






What is difference between array and vector?

521


What is string literal in java?

544


What is treemap in java?

539


What are the difference between composition and inheritance in java?

504


For class CFoo { }; what default methods will the compiler generate for you>?

604


What makes a function well defined?

503


Is the milky way in a void?

534


What is core java used for?

501


Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?

604


What are different types of multitasking?

532