98-372 · Question #63
Dennis has just started an internship with Company Inc., as a developer. He develops an application named App1 using .NET Framework 4.0. App1 contains a class named Class1, which is stored in a…
The correct answer is D. using Alias1 = BlueWell.Namespace1.Class1. A namespace allows developers to organize and uniquely qualify element names and relationships defined in an assembly. When an object reference is prefixed with the name of the namespace where it is defined, it is known as the fully qualified name of the object. Since the fully…
Question
Dennis has just started an internship with Company Inc., as a developer. He develops an application named App1 using .NET Framework 4.0. App1 contains a class named Class1, which is stored in a namespace named BlueWell.Namespace1. Dennis wants to create another class named Class2, and use Class1 from Class2. For this, he wants to define an alias named Alias1, and use it in Class2. Which of the following statements will Dennis use to define Alias1?
Options
- AAlias1 = BlueWell.Namespace1.Class1;
- BBlueWell.Namespace1.Class1, Alias1;
- CBlueWell.Namespace1.Class1 : Alias1;
- Dusing Alias1 = BlueWell.Namespace1.Class1;
How the community answered
(17 responses)- A6% (1)
- C18% (3)
- D76% (13)
Explanation
A namespace allows developers to organize and uniquely qualify element names and relationships defined in an assembly. When an object reference is prefixed with the name of the namespace where it is defined, it is known as the fully qualified name of the object. Since the fully qualified names can be long, they can be used by defining aliases for them. Following is the syntax for defining an alias for a fully qualified name: using Alias1 = BlueWell.Namespace1.Class1; Here, if developers will attempt to use Class1 without using the fully qualified name or the alias, Visual C# .NET will produce an error.
Topics
Community Discussion
No community discussion yet for this question.