Home »
Aptitude Questions and Answers »
C# Aptitude Questions and Answers
C# Namespace Aptitude Questions and Answers | Set 2
C# Namespace Aptitude Questions | Set 2: This section contains aptitude questions and answers on C# Namespace.
Submitted by Nidhi, on April 08, 2020
1) Can we create a nested namespace in C#.NET?
- Yes
- No
Correct answer: 1
Yes
Yes, we can create a nested namespace in C#.NET.
2) A namespace can contain an interface in C#.NET?
- Yes
- No
Correct answer: 1
Yes
Yes, a namespace can contain an interface.
3) There are following statements are given below, which of them are correct about namespace in C#.NET?
- We cannot create a nested namespace.
- In C#.Net, there is no limit for nested levels for a namespace.
- We can create nested namespaces up to 4 levels only.
- To create nested namespace we need to use “using” keyword.
Options:
- Only A
- D and C
- Only B
- Only D
Correct answer: 3
Only B
The only statement B is correct about namespace in C#.NET.
4) There are following statements are given below, which of them are correct about namespace in C#.NET?
- In C#.NET, every class belongs to a namespace.
- A namespace can contain either a class or a structure.
- All members of the namespace must be in the same file.
- By default name of the namespace is the project name.
Options:
- A and D
- Only B
- Only C
- B and C
Correct answer: 1
A and D
The statements A and D are correct about namespaces.
5) There are following namespaces are given below, which of them are not valid namespace of .NET Framework Class Library?
- Data
- Process
- Web
- Drawing2D
Options:
- Only A
- B and D
- Only C
- A and C
Correct answer: 2
B and D
In the above options, B and D are not valid namespaces of FCL.