2. | Creating empty structures is allowed in C#.NET. |
Discuss |
Answer: (b).False
|
3. | Which of the following will be the correct output for the C#.NET program given below?
|
Discuss |
Answer: (c).20 10
|
4. | Which of the following is the correct way of setting values into the structure variable e defined below?
|
Discuss |
Answer: (a).e.name = "Amol";
e.age = 25; e.sal = 5500; |
5. | Which of the following is the correct way to define a variable of the type struct Emp declared below? 1. Emp e(); e = new Emp(); 2. Emp e = new Emp; 3. Emp e; e = new Emp; 4. Emp e = new Emp(); 6. Emp e;
|
Discuss |
Answer: (c).4, 5
|
6. | Which of the following statements is correct about the C#.NET code snippet given below?
|
Discuss |
Answer: (d).ss will be created on the stack.
|
7. | How many bytes will the structure variable samp occupy in memory if it is defined as shown below?
|
Discuss |
Answer: (b).12 bytes
|
8. | Which of the following will be the correct result of the statement b = a in the C#.NET code snippet given below?
|
Discuss |
Answer: (a).All elements of a will get copied into corresponding elements of b.
|
9. | Which of the following statements are correct? 1. A struct can contain properties. 2. A struct can contain constructors. 3. A struct can contain protected data members. 4. A struct cannot contain methods. 5. A struct cannot contain constants. |
Discuss |
Answer: (a).1, 2
|
10. | When would a structure variable get destroyed? |
Discuss |
Answer: (c).When it goes out of scope.
|