What is Interface? Explain with an example.

Answer Posted / mohit bhandari

An interface is a named set of method signatures.Interfaces
can also define events and properties because all of these
are just syntax shorthands that map to methods anyway.
In C#, interface keyword is used to define an interface,
giving it a name and its set of instance method signatures.
e.g.
public interface IDisposable {
void Dispose();
}

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

These questions were asked me in a technical interview: •If we deploy an application on multiple server (like database server, web server) then, each request should be redirected to proper server, then how you will handle it in your code? •How security pinholes will be handled in an application? •What things should be considered while writing a web application? •How will you do load/performance testing of web application? Which framework you will use for it? •How will you implement a cache for results which require a DB access? Please let me know how to write an web application considering all these points. I am not so much aware of architechural design of web application. Your guidelines will be helpful.

2501


Describe two uses of the “using” statement during the operation of c#?

545


What is private variable?

482


What is multithreading? What are the problems that comes with multithreading and how to manage them?

547


How Reflection is used and what it's significance ?

520






Classes and structs can be declared as static, is this statement true or false?

549


Name the property of the textbox which cannot be changed at runtime?

517


Define Abstract Class in C#

540


update data in an xml file which resides in solution itself, using silverlight 4.0

1372


When should we use delegates in c#?

486


Are tuples immutable c#?

501


Is post back in c#?

517


What is cshtml?

519


What is application c#?

491


What is datareader c#?

489