C# Programming - Interfaces - Discussion

Discussion :: Interfaces - General Questions (Q.No.2)

2. 

Which of the following can be declared in an interface?

  1. Properties
  2. Methods
  3. Enumerations
  4. Events
  5. Structures

[A]. 1, 3
[B]. 1, 2, 4
[C]. 3, 5
[D]. 4, 5

Answer: Option B

Explanation:

No answer description available for this question.

Samir Sayyad said: (Jan 10, 2012)  
An interface can contain one or more methods, properties, indexers and events but none of them are implemented in the interface itself.

Samir Sayyad said: (Jan 10, 2012)  
An interface can contain one or more methods,properties,indexers and events but none of them are implemented in the interface itself.

Anupam said: (Jul 21, 2013)  
An interface can contain one or more methods, properties, indexers and events but none of them are implemented in the interface itself.

Constantine said: (Sep 30, 2014)  
Why it can't have enum and Structures?

Mohammad Amir Suhel said: (Dec 3, 2014)  
1) Enum is variable not the type, so you can not put the enum in interface.

2) Interface is kind of contract.

Prem said: (Feb 12, 2015)  
Is this correct an interface can contain one or more methods and properties.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.