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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use interface in c#?

478


How to force my .net app to run as administrator on windows 7?

496


Explain the difference between class and interface in .net?

426


What is default access specifier for class in c#?

468


What is the difference between delegates and superdelegates?

457






Are cao stateful in nature?

469


How can we set the class to be inherited, but prevent the method from being over-ridden?

473


what is a static constructor?

661


What does dbml mean?

493


What is the difference between abstract class and interface in c#?

482


What is difference between method and function in c#?

464


What is the implicit name of the parameter that gets passed into the class set method?

481


Is lazy thread safe c#?

495


What is reflection c#?

465


What is the use of convert toint32 in c#?

516