can we create an empty interface with no definitions? If
so, how it should be called in the class?

Answers were Sorted based on User's Feedback



can we create an empty interface with no definitions? If so, how it should be called in the class?..

Answer / rajat

Yes, we can create an empty interface in C#. Since the
interface does not have any method, no need to implement
any method in the class.

Is This Answer Correct ?    8 Yes 0 No

can we create an empty interface with no definitions? If so, how it should be called in the class?..

Answer / bindu sharma

Yes we can create an empty interface.Empty interface is
called a marker interface.It is used by Comiler so we don't
need to call it explicitly.As there is no method in marker
interface,So we don't need to call it.

Is This Answer Correct ?    8 Yes 1 No

can we create an empty interface with no definitions? If so, how it should be called in the class?..

Answer / mohit bhandari

Yes we can create an empty interface.Empty interface is
called a marker interface.These interfaces are generally
used as way of identifying a group of types. If this
identification will occur at runtime, the correct way to
accomplish this is to use a custom attribute. Use the
presence or absence of the attribute, or the attribute's
properties, to identify the target types.As there is no
method in marker interface,So we don't need to call it.

Is This Answer Correct ?    7 Yes 1 No

Post New Answer

More C Sharp Interview Questions

What is sql transaction in c#?

0 Answers  


Give 2 scenarios where static constructors can be used?

0 Answers  


Who is a accessibility modifier “protected internal” available to ?

0 Answers   Siebel,


Is for loop faster than foreach?

0 Answers  


What does it meant to say “the canonical” form of XML ?

1 Answers  






Can we define a variable with the access modifier private in an interface?

7 Answers   IBM,


Explain the difference between “constant” and “read-only” variables used in c#?

0 Answers  


Which is the base class in c#?

0 Answers  


What is lazy class in c#?

0 Answers  


Can interface have virtual methods in c#?

0 Answers  


Suppose you have already existing application with Visual Studio 6 (VB 6, InterDev 6) and this application utilizes Windows 2000 COM+ transaction services. With this example how can you approach migrating this application to .NET?

0 Answers   Siebel,


What is tochararray in c#?

0 Answers  


Categories