Have you failed a job interview?
Send us your job interview questions and get correct answers.
What is a namespace in C# and what is it good for?
Experience Level: Junior
- A namespace is like a box that you can use for storing your classes.
- It is used for organizing code.
- A namespace can contain zero, one or more classes.
- A namespace is created using
- A namespace name consists of one string or multiple strings delimited by dot character.
- It is a best practice to start each word of the namespace name by a capital letter.
- One namespace can be used in multiple .cs files.
- There can be multiple namespaces in one .cs file.
Related C# job interview questions
What is a class in C#?C# Junior
What are the advantages of using 'using' keyword in C# and why would you use it?C# Junior
What is abstract class and what is it good for?C# Medior
What is covariance and contravariance?.NETASP.NET MVCASP.NET WebAPIASP.NET WebFormsC# Senior
Have you ever consumed some 3rd party API? What was it? Have you ever designed your own API? Could you describe it a bit?.NETArchitectureASP.NET WebAPIC#Web services Medior