Multiple choice technology programming languages

namespace keyword in C# and C++ refers to

  1. namespace in C# refers to a holder where name collisions can be avoided whereas in C++ it is used to define templates

  2. namespace in C# and C++ are for same purpose

  3. namespace in C# refers to a holder where name collisions can be avoided whereas in C++ it is used to define STL classes

  4. namespace in C# refers to a holder where name collisions can be avoided whereas in C++ it is undefined.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Both C# and C++ use namespaces for the same purpose: to organize code and prevent naming collisions by providing a scope for identifiers. The concept is identical in both languages.