Wednesday, 3 July 2013

.NET CSHARP BASIC MULTUPLE CHOICE QUESTIONS - K MANOHAR GOUD IT TRAINER DEVELOPER HYDERABAD - 9866550012

9866550012

.NET CSHARP BASIC MULTUPLE CHOICE QUESTIONS

The space required for structure variables is allocated on stack.
A.TrueB.False
Creating empty structures is allowed in C#.NET.
A.TrueB.False

C#.NET structures are always value types.
A.TrueB.False

Which of the following are true about classes and struct?
  1. A class is a reference type, whereas a struct is a value type.
  2. Objects are created using new, whereas structure variables can be created either using new or without using new.
  3. A structure variable will always be created slower than an object.
  4. A structure variable will die when it goes out of scope.
  5. An object will die when it goes out of scope.
A.1, 2, 4
B.3, 5
C.2, 4
D.3, 4, 5

Which of the following statements are correct about Structures used in C#.NET?
  1. A Structure can be declared within a procedure.
  2. Structs can implement an interface but they cannot inherit from anotherstruct.
  3. struct members cannot be declared as protected.
  4. A Structure can be empty.
  5. It is an error to initialize an instance field in a struct.
A.1, 2, 4
B.2, 3, 5
C.2, 4
D.1, 3

When would a structure variable get destroyed?
A.When no reference refers to it, it will get garbage collected.
B.Depends upon whether it is created using new or without using new.
C.When it goes out of scope.
D.Depends upon the Project Settings made in Visual Studio.NET.
E.Depends upon whether we free it's memory using free() or delete().

Which of the following statements is correct?
A.A struct never declares a default constructor.
B.All value types in C# inherently derive from ValueType, which inherits fromObject.
C.A struct never declares a default destructor.
D.In C#, classes and structs are semantically same.

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.
A.1, 2
B.3, 4
C.1, 2, 4
D.3, 5



No comments:

Post a Comment