C# Programming - Structures - Discussion
Discussion Forum : Structures - General Questions (Q.No. 18)
18.
Which of the following statements are correct about Structures used in C#.NET?
- A Structure can be declared within a procedure.
- Structs can implement an interface but they cannot inherit from another struct.
- struct members cannot be declared as protected.
- A Structure can be empty.
- It is an error to initialize an instance field in a struct.
Discussion:
2 comments Page 1 of 1.
Sarath said:
1 decade ago
Structure do not support inheritance.
Nicholas Mahbouby said:
1 decade ago
Answer 4 is also correct. Structures can be empty. The code following code will compile, however in reality the struct inherits members from the base class System.ValueType and is not really empty.
struct A
{
}
struct A
{
}
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers