logo
  • Home
  • About
  • Training
  • Programming
  • CS
  • IT
  • IS
  • ECE
  • EEE
  • EE
  • Civil
  • Mechanical
  • Chemical
  • Metallurgy
  • Instrumentation
  • Aeronautical
  • Aerospace
  • Biotechnology
  • Agriculture
  • MCA
  • BCA
  • Internship
  • Contact

C# Multiple Choice Questions | MCQs | Quiz

C# Interview Questions and Answers
Pratice C# questions and answers for interviews, campus placements, online tests, aptitude tests, quizzes and competitive exams.

Get Started

•   Integer Data Types
•   Floating Data Types
•   String Literals
•   Variables Initialization
•   Variables Scope & Lifetime
•   Expression Type Conversion
•   Arithmetic Operators
•   Logical Operators
•   Bit Wise Operators
•   IF Statements
•   Switch Statements
•   For Loop Statements
•   While Loop Statements
•   Do While Loop Statements
•   Continue & Goto statement
•   Class Fundamentals
•   Reference Variables
•   Methods in Class
•   Constructors in Class
•   Destructors in Class
•   Array & Initialization
•   Strings Basic Operation
•   String Class Description
•   Strings Comparison
•   Modifying Strings
•   Characters Operation
•   Private Access Modifier
•   Ref & Out Parameters
•   Variable Arguements
•   Polymorphism
•   Structures
•   Enumerations
•   Inheritance Fundamentals
•   Inheritance Implementation
•   Method Overloading
•   Method Overriding
•   Constructor Overloading
•   Abstract Class & Methods
•   Interfaces Introduction
•   Interfaces Implementation
•   Overloaded Operators
•   Recursion
•   Indexers Basics
•   Properties Basics
•   Properties & Its Application
•   Exception Handling Basics
•   Exception Implementation
•   Built In Exceptions
•   Detail Try & Catch
•   Attributes
•   Console I/O Operations
•   Reading Console Input
•   Writing Console Output
•   Stream Classes Basics
•   Byte Stream
•   Character Stream
•   Delegates Fundamentals
•   Detail Delegates
•   Generics Fundamentals
•   Generic Methods
•   LINQ Fundamentals
•   LINQ Operation & Query
•   Array Class Basics
•   Runtime Type
•   Reflections Basics
•   Collection Classes
•   Maths Class
•   C# Rounding Functions
•   Multi-threaded Programs - 1
•   Multi-threaded Programs - 2
•   Iterators
•   Namespaces Fundamentals
•   Preprocessor Fundamentals
•   Parameters Method
•   Networking Fundamentals
•   URI Class
•   Network Errors Handling
•   Type Interface
•   Unsafe Code & Pointers
•   Pointers Operation - 1
•   Pointers Operation - 2
•   Class Accessor Controls
•   String Formatting Basics
•   String Formatting - 1
•   String Formatting - 2

Best Reference Books

C# Books
« Prev Page
Next Page »

C# Questions & Answers – Fundamentals of Namespaces

Posted on September 11, 2013 by staff10

This section of our 1000+ C# MCQs focuses on namespaces fundamental in C# Programming Language.

1. Which of the following is not a namespace in the .NET Framework Class Library?
a) System.Process
b) System.Security
c) System.Threading
d) System.xml
View Answer

Answer: a
Explanation: None.

2. Which is the correct statement about the namespaces in C#.NET?
a) Nesting of namespaces is permitted, provided all the inner namespaces are declared in the same file
b) A namespace cannot be tested
c) There is no limit on the number of levels while nesting namespaces
d) All of the mentioned
View Answer

Answer: c
Explanation: None.

3. Which among the following does not belong to the C#.NET namespace?
a) class
b) struct
c) enum
d) data
View Answer

Answer: d
Explanation: None.

4. Which among the following is a correct statement about namespace used in C#.NET?
a) Classes must belong to a namespace, whereas structures need not
b) All elements of the namespace must to belong to one file
c) If not mentioned, a namespace takes the name of the current project
d) All of the mentioned
View Answer

Answer: c
Explanation: None.

5. Which among the given is not a correct way to call the method Issue() defined in the code snippet given below?

  1. class Book
  2. {
  3.     public void issue()
  4.     {
  5.       /* code */
  6.     }
  7. }
  8. class Journel
  9. {
  10.      public void issue()
  11.      {
  12.          /* code */
  13.      }
  14. }

a) College.Lib.Book b = new College.Lib.Book();
b.issue();
b) Book b = new Book();
b.issue();
c) using College.Lib;
Book b = new Book();
b.issue();
d) All of the mentioned
View Answer

Answer: b
Explanation: None.

6. Which among the following statements are not correct about a namespace used in C#.NET?
a) Nested namespaces are allowed
b) Importing outer namespaces imports inner namespace
c) Nested namespaces are allowed
d) Importing outer namespace does not import inner namespace
View Answer

Answer: b
Explanation: None.

7. Which among the following is a .NET namespace?
a) System.Web
b) System.Process
c) System.Drawing2D
d) System.Drawing3D
View Answer

Answer: a
Explanation: None.

8. If a class named csharp is present in namespace n1 as well as in namespace n2,then which of the following is the correct way to use csharp class?

a) class Program
   {
     static void Main(string[] args)
     {
        import n1;
        csharp x = new csharp();
        x.fun();
        import n2;
        csharp y = new csharp();
        y.fun();
     }
   }
b) import n1;
   import n2;
   namespace ConsoleApplication1
   {
      class Program
   {
     static void Main(string[] args)
     {
 
       n1.csharp x = new n1.csharp();
        x.fun();
        import n2;
        n2.csharp y = new n2.csharp();
        y.fun();
     }
   }
}
c)   class Program
   {
     static void Main(string[] args)
     {
       using n1;
       csharp x = new csharp();
       x.fun();
       using n2;
       csharp y = new csharp();
        y.fun();
     }
   }
d) using n1;
   using n2;
   namespace ConsoleApplication1
   {
      class Program
   {
     static void Main(string[] args)
     {
 
       n1.csharp x = new n1.csharp();
        x.fun();
        import n2;
        n2.csharp y = new n2.csharp();
        y.fun();
     }
   }
}
View Answer
Answer: c
Explanation: None.
 
 

9. If ListBox is the class of System.Windows.Forms namespace.Then,correct way to create an object of ListBox class is?
a) using System.Windows.Forms;
ListBox I = new ListBox();
b) System.Windows.Forms.ListBox I = new System.Windows.Forms.ListBox();
c) using LBControl I = new System.Windows.Forms.ListBox;
d) All of the mentioned
View Answer

Answer: d
Explanation: None.

10. Which among the following is the correct statement about the using statement used in C#.NET?
a) A C#.NET source code file consists of any number of using statement
b) By using ‘using’ statement it’s possible to create an alias for the namespace but not for the namespace element
c) It is permitted to define a member at namespace level using alias
d) Using statement can be placed anywhere in the C#.NET source code file
View Answer

Answer: c
Explanation: None.

Sanfoundry Global Education & Learning Series – C# Programming Language.

Here’s the list of Best Reference Books in C# Programming Language.

To practice all features of C# programming language, here is complete set on 1000+ Multiple Choice Questions and Answers on C#.

« Prev Page - C# Question & Answers – Iterators
» Next Page - C# Questions & Answers – Fundamentals of Preprocessors
« C# Question & Answers – Iterators
C# Questions & Answers – Fundamentals of Preprocessors »

Deep Dive @ Sanfoundry:

  1. C# Programming Examples on Interfaces
  2. C# Programming Examples on Delegates
  3. C# Programming Examples on Strings
  4. C# Programming Examples on Threads
  5. C# Programming Examples on Inheritance
  6. C# Programming Examples on Matrix
  7. C# Programming Examples on Files
  8. C# Programming Examples
  9. C# Questions and Answers
  10. C# Programming Examples on Functions
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below:
LinkedIn | Facebook | Twitter | Google+

Best Careers

Developer Tracks
SAN Developer
Linux Kernel Developer
Linux Driver Developer
Linux Network Developer

Live Training Photos
Mentoring
Software Productivity
GDB Assignment
Sanfoundry is No. 1 choice for Deep Hands-ON Trainings in SAN, Linux & C, Kernel Programming. Our Founder has trained employees of almost all Top Companies in India such as VMware, Citrix, Oracle, Motorola, Ericsson, Aricent, HP, Intuit, Microsoft, Cisco, SAP Labs, Siemens, Symantec, Redhat, Chelsio, Cavium, ST-Micro, Samsung, LG-Soft, Wipro, TCS, HCL, IBM, Accenture, HSBC, Mphasis, Tata-Elxsi, Tata VSNL, Mindtree, Cognizant and Startups.

Best Trainings

SAN I - Technology
SAN II - Admin
Linux Fundamentals
Advanced C Training
Linux-C Debugging
System Programming
Network Programming
Linux Threads
Kernel Programming
Kernel Debugging
Linux Device Drivers

Best Reference Books

Computer Science Books
Algorithm & Programming Books
Electronics Engineering Books
Electrical Engineering Books
Chemical Engineering Books
Civil Engineering Books
Mechanical Engineering Books
Industrial Engineering Books
Instrumentation Engg Books
Metallurgical Engineering Books
All Stream Best Books

Questions and Answers

1000 C Questions & Answers
1000 C++ Questions & Answers
1000 C# Questions & Answers
1000 Java Questions & Answers
1000 Linux Questions & Answers
1000 Python Questions
1000 PHP Questions & Answers
1000 Hadoop Questions
Cloud Computing Questions
Computer Science Questions
All Stream Questions & Answers

India Internships

Computer Science Internships
Instrumentation Internships
Electronics Internships
Electrical Internships
Mechanical Internships
Industrial Internships
Systems Internships
Chemical Internships
Civil Internships
IT Internships
All Stream Internships

About Sanfoundry

About Us
Copyright
TOS & Privacy
Jobs
Bangalore Training
Online Training
SAN Training
Developers Track
Mentoring Sessions
Contact Us
Sitemap
© 2011 Sanfoundry