C# Programming - Interfaces - Discussion

Discussion Forum : Interfaces - General Questions (Q.No. 14)
14.
Which of the following statements is correct about the C#.NET code snippet given below?
interface IPerson
{ 
    String FirstName
    { 
        get; 
        set;
    }
    String LastName
    {
        get; 
        set;
    }
    void Print(); 
    void Stock(); 
    int Fun(); 
}
Properties cannot be declared inside an interface.
This is a perfectly workable interface.
The properties in the interface must have a body.
Subroutine in the interface must have a body.
Functions cannot be declared inside an interface.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
2 comments Page 1 of 1.

Manhkamen said:   1 decade ago
I don't know to much c# but I want to study more from another one.

I think int Fun(); need have value to return ? Please tell with me why not? Thank everyone

Akash Jain said:   8 years ago
I think, Instead of using 'String' use 'string'.

Post your comments here:

Your comments will be displayed after verification.