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
Can we have multiple constructors in a class c#?
Why do we need delegates in c#?
What is the use of inheritance in c#?
What is the difference between a field and a property in c#?
What is a nullreferenceexception?
How do I open the console?
What is the benefit of interface in c#?
Is c# and .net same?
Distinguish between array and arraylist in c#?
Can class inherit from struct c#?
What is the difference between continue and break statement?
What is the difference between console application and windows application?
What are the types of constructors?
What is the default value of guid in c#?
Explain copy constructor?