Question: Question 11 An interface member that is explicitly implemented can be accessed only through an instance of the interface, not from a class instance True
Question 11
An interface member that is explicitly implemented can be accessed only through an instance of the interface, not from a class instance
| True |
| False |
Question 12
Find correct statement about the code?
class sample
{
int i = 10;
int j = 20;
public void display()
{
Console.WriteLine("base method ");
}
}
class sample1 : sample
{
public int s = 30;
}
class Program
{
static void Main(string[] args)
{
sample1 obj = new sample1();
Console.WriteLine("{0}, {1}, {2}", obj.i, obj.j, obj.s);
obj.display();
Console.ReadLine();
}
}
| 10, 20, 30 Base method |
| 10, 20, 0 |
| Compile time error |
| Base method |
Question 13
Does .NET support the ability to inherit multiple interfaces?
| Yes |
| No |
| No answer text provided. |
| No answer text provided. |
Question 14
Which statement best describes the relationship between base class and derived class types?
| A derived class reference cannot be assigned to a base class variable and a base class reference cannot be assigned to a derived class variable. |
| A derived class reference can be assigned to a base class variable and a base class reference can be assigned to a derived class variable. |
| A base class reference can be assigned to a derived class variable, but a derived class reference cannot be assigned to a base class variable |
| A derived class reference can be assigned to a base class variable, but a base class reference cannot be assigned to a derived class variable |
Question 15
Classes which implement the IEnumerator interface must contain which of the following methods?
A) MoveNext
B) Reset
C) Current
D) Reverse
| A, B, C |
| B, C, D |
| A, B, D |
| A, C, D |
Question 16
Which of the following is true regarding a sealed class?
| It is ready to be serialized. |
| It is packaged in a DLL. |
| It cannot be inherited. |
| It may not reference any classes in the .NET library. |
Question 17
The class SmithKarenCreature inherits from the class Creature . An instance of SmithKarenCreature is created and referenced in the variable kCreature using the following code: SmithKarenCreature kCreature = new SmithKarenCreature();
A variable called creature of type Creature is declared and kCreature is cast as type Creature and assigned to creature using the following line of code:
Creature creature = (Creature)kCreature;
Which of the following is an alternative syntax to the above line of code?
| Creature creature = Creature as kCreature; |
| Creature creature = kCreature as Creature; |
| Creature (SmithKarenCreature) creature = kCreature; |
| Creature creature = (SmithKarenCreature as Creature) kCreature; |
Question 18
In C# all non-static methods are by default virtual functions.
| True |
| False |
| No answer text provided. |
| No answer text provided. |
Question 19
An abstract method can only be declared in a class that is declared as abstract.
| True |
| False |
Question 20
It is an error to use both new and override on the same member because the two modifiers have mutually exclusive meanings. The new modifier creates a new member with the same name and causes the original member to become hidden. The override modifier extends the implementation for an inherited member.
| True |
| False |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
