M

Mr. Dubey • 52.52K Points
Coach

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 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
  • Correct Answer - Option(B)
  • Views: 78
  • Filed under category C#

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.

Related MCQs on C#

Q. Which of these can be overloaded?

Q. Which of the following assemblies can be stored in Global Assembly Cache?

Q. Number of constructors a class can define of ?

Q. Which of the following statements are correct about JIT? 1. JIT compiler compiles instructions into machine code at run time. 2. The code compiler by the JIT compiler runs under CLR. 3. The instructions compiled by JIT compilers are written in native code. 4. The instructions compiled by JIT compilers are written in Intermediate Language (IL) code. 5. The method is JIT compiled even if it is not called

Q. Which of the following can be facilitated by the Inheritance mechanism? 1 Use the existing functionality of base class. 2 Override the existing functionality of base class. 3 Implement new functionality in the derived class. 4 Implement polymorphic behaviour. 5 Implement containership.

Q. Duck typing is implemented by using_________ keyword.

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

Q. Correct statement about constructors in C#.NET is ?

Q. Which of the following is the correct way to access all elements of the Queue collection created using the C#.NET code snippet given below? Queue q = new Queue(); q.Enqueue("Sachin"); q.Enqueue('A'); q.Enqueue(false); q.Enqueue(38); q.Enqueue(5.4);

Q. The file steam class is designed specifically for reading and writing_______________ files.

Learn All C# MCQs


Question analytics