1) There are following statements are given below, which of them are correct about structure in C#?
- The structure is composite data-type; it contains de-similar data elements.
- The structure is a reference type.
- An instance of the structure stored in the stack.
- The structure does not support by C#.NET.
Options:
- Only A
- Only C
- B and D
- A and C
Correct answer: 4
A and C
In the given statements, A and C statements are correct about structure in C#.NET.
2) A structure can contain?
- Methods
- Constructors
- Properties
- Indexers
Options:
- Only A
- Only B
- A and B
- All
Correct answer: 4
All
A structure can contain all the given options.
3) Structure members are by default?
- Public
- Private
- Protected
- Internal
Correct answer: 2
Private
The members of the structure are private by default.
4) Structures are?
- Value type
- Reference type
- Both
- None
Correct answer: 1
Value type
Structures are value types in C#.NET.
5) What keyword is used to declare a structure in C#.NET?
- structure
- System.Structure
- struct
- str
Correct answer: 3
struct
In C#.Net, to declare a structure, we need to use the struct keyword.