C# Programming :: Namespaces
-
If a namespace is present in a library then which of the following is the correct way to use the elements of the namespace?
-
Which of the following is NOT a namespace in the .NET Framework Class Library?
-
Which of the following statments are the correct way to call the method Issue() defined in the code snippet given below?
namespace College { namespace Lib { class Book { public void Issue() { // Implementation code } } class Journal { public void Issue() { // Implementation code } } } }
College.Lib.Book b = new College.Lib.Book(); b.Issue();
Book b = new Book(); b.Issue();
using College.Lib; Book b = new Book(); b.Issue();
using College; Lib.Book b = new Lib.Book(); b.Issue();
using College.Lib.Book; Book b = new Book(); b.Issue();
-
Which of the following statements is correct about a namespace in C#.NET?
-
Which of the following is absolutely neccessary to use a class Point present in namespace Graph stored in library?
-
If a class called Point is present in namespace n1 as well as in namespace n2, then which of the following is the correct way to use the Point class?
-
Which of the followings are NOT a .NET namespace?
- System.Web
- System.Process
- System.Data
- System.Drawing2D
- System.Drawing3D
-
Which of the following statements is correct about namespaces in C#.NET?
-
Which of the following is correct way to rewrite the C#.NET code snippet given below?
using Microsoft.VisualBasic; using System.Windows.Forms; MessageBox.Show("Wait for a" + ControlChars.CrLf + "miracle");
-
Which of the following statements is correct about the using statement used in C#.NET?
A.
Add Reference of the namespace.
Use the elements of the namespace. |
B.
Add Reference of the namespace.
Import the namespace. Use the elements of the namespace. |
C.
Import the namespace.
Use the elements of the namespace. |
D.
Copy the library in the same directory as the project that is trying to use it.
Use the elements of the namespace. |
E.
Install the namespace in Global Assembly Cache.
Use the elements of the namespace. |
A.
Namespaces help us to control the visibility of the elements present in it.
|
B.
A namespace can contain a class but not another namespace.
|
C.
If not mentioned, then the name 'root' gets assigned to the namespace.
|
D.
It is necessary to use the using statement to be able to use an element of a namespace.
|
E.
We need to organise the classes declared in Framework Class Library into different namespaces.
|
A.
|
B.
|
C.
|
D.
|
A.
Namespaces can be nested only up to level 5.
|
B.
A namespace cannot be nested.
|
C.
There is no limit on the number of levels while nesting namespaces.
|
D.
If namespaces are nested, then it is necessary to use using statement while using the elements of the inner namespace.
|
E.
Nesting of namespaces is permitted, provided all the inner namespaces are declared in the same file.
|
A.
|
B.
|
C.
|
D.
|
A.
using statement can be placed anywhere in the C#.NET source code file.
|
B.
It is permitted to define a member at namespace level as a using alias.
|
C.
A C#.NET source code file can contain any number of using statement.
|
D.
By using using statement it is possible to create an alias for the namespace but not for the namespace element.
|
E.
By using using statement it is possible to create an alias for the namespace element but not for the namespace.
|