C# Programming - Datatypes - Discussion

Discussion Forum : Datatypes - General Questions (Q.No. 11)
11.
Which of the following statements are correct?
  1. We can assign values of any type to variables of type object.
  2. When a variable of a value type is converted to object, it is said to be unboxed.
  3. When a variable of type object is converted to a value type, it is said to be boxed.
  4. Boolean variable cannot have a value of null.
  5. When a value type is boxed, an entirely new object must be allocated and constructed.
2, 5
1, 5
3, 4
2, 3
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
13 comments Page 2 of 2.

Pankaj jindal said:   8 years ago
According to me, option 4 is also correct.

Omkar said:   7 years ago
Boolean is value type in C# hence must not be null.

Rajesh said:   7 years ago
If bool? declare like that so it can be store null value by a null character. It means 1st and 5th are correct.


Post your comments here:

Your comments will be displayed after verification.