Question: C# Multiple Choice Questions: If two classes of the same name occur in two different namespaces and both namespaces are used (included) what must be

C# Multiple Choice Questions:

If two classes of the same name occur in two different namespaces and both namespaces are used (included) what must be done when using the classes?

Just use the name of the class. The C# compiler will figure out by the context which is the correct class to use
Provide a fully qualified path to the class that includes the name space and the name of the class.
Right click on the class name in the code and select the correct class from the popup menu that appears.
It is not possible to have two classes that are named the same thing in C#.

If a method of a class is protected which of the following is true?

The method cannot be used.
The method can only be used on an instance of an object.
The method must be overridden to be used.
The method can only be accessed in the class or a subclass.

In List what is the purpose of ?

To indicate the total number of items the list can hold.
To indicate the method that is used to manipulate the list.
To indicate the type of data the list can hold.

To indicate the time interval between garbage collections on the list.

Does .NET support the ability to inherit multiple interfaces?

Yes
No

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.

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;

In C# all non-static methods are by default virtual functions.

True
False

An abstract method can only be declared in a class that is declared as abstract.

True
False

Which of the following best describes what a delegate is?

A strongly typed function pointer.
A lightweight thread or process that can call a single method.
A reference to an object in a different process.
An interprocess message channel

The statement Stack objectStack = new Stack(); indicates that object Stack stores _______ .

Object
Stack
integers
strings

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!