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

Where do we use serialization in c#?

701


Is php easier than c#?

697


Is it not possible to store a boolean value as a variable?

658


What is interface inheritance?

742


How does bitwise xor work?

671


What is Event - Delegate?

830


Describe the process of “exception handling implementation” in c#?

766


Why we use delegates in c#?

711


Explain polymorphism in c# with a simple example?

717


Can a struct inherit from another struct or class in c#?

726


What is the main method in c#?

766


What is a shared assembly?

763


What is difference between destructor and finalize?

663


Can we change static value in c#?

778


What is serialization and deserialization in c# with example?

695