adplus-dvertising
frame-decoration

Question

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.

a.

2, 5

b.

1, 5

c.

3, 4

d.

2, 3

Posted under C# programming

Answer: (b).1, 5

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. 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...

Similar Questions

Discover Related MCQs

Q. Which of the following is the correct ways to set a value 3.14 in a variable pi such that it cannot be modified?

Q. Which of the following is the correct default value of a Boolean type?

Q. Which of the following is NOT an Arithmetic operator in C#.NET?

Q. Which of the following is NOT a Bitwise operator in C#.NET?

Q. Suppose n is a variable of the type Byte and we wish, to check whether its fourth bit (from right) is ON or OFF. Which of the following statements will do this correctly?

Q. Suppose n is a variable of the type Byte and we wish to put OFF its fourth bit (from right) without disturbing any other bits. Which of the following statements will do this correctly?

Q. Which of the following statements is correct about Bitwise | operator used in C#.NET?

Q. Which of the following is NOT an Assignment operator in C#.NET?

Q. Which of the following statements is correct about Bitwise ^ operator used in C#.NET?

Q. How many Bytes are stored by ‘Long’ Datatype in C# .net?

Q. Choose “.NET class” name from which datatype “UInt” is derived ?

Q. Correct Declaration of Values to variables ‘a’ and ‘b’?

Q. Arrange the following datatype in order of increasing magnitude sbyte, short, long, int.

Q. Which datatype should be more preferred for storing a simple number like 35 to improve execution speed of a program?

Q. Which Conversion function of ‘Convert.TOInt32()’ and ‘Int32.Parse()’ is efficient?

1) Int32.Parse() is only used for strings and throws argument exception for null string
2) Convert.Int32() used for datatypes and returns directly ‘0’ for null string

Q. Correct way to assign values to variable ‘c’ when int a=12, float b=3.5,int c;

Q. Correct Set of Code for given data ‘a’ and ‘b’ to print output for ‘c’ as 74 ?

Q. Default Type of number without decimal is ?

Q. Select a convenient declaration and initialization of a floating point number:

Q. Number of digits upto which precision value of float datatype is valid ?