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
What does readonly mean in c#?
What is a derived class in c#?
Can abstract class have constructor?
When would you use generics in your code c#?
What is form feed and carriage return?
What is difference between a type and class?
Write a console application and implement the ternary operator to decide whether the age a user entered after being prompted is allowed to vote or not(given that only citizens between 18 and 120 years only inclusive can vote). Use exception handling for non-numerical input.
How to move to a state-related codebase?
What is anonymous types in c#?
Tell me the difference between call by value and call by reference.
Explain the functionalities of satellite assembly?
Why abstract class can not be instantiated?
What are the types in c#?
What is icomparable in c#?
How many classes are there in classification?