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

What does readonly mean in c#?

645


What is a derived class in c#?

574


Can abstract class have constructor?

576


When would you use generics in your code c#?

578


What is form feed and carriage return?

574






What is difference between a type and class?

709


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.

1973


How to move to a state-related codebase?

1011


What is anonymous types in c#?

585


Tell me the difference between call by value and call by reference.

615


Explain the functionalities of satellite assembly?

629


Why abstract class can not be instantiated?

540


What are the types in c#?

595


What is icomparable in c#?

617


How many classes are there in classification?

584