Question 57Asked in Bihar STET Paper 2 Computer Science (Class 11-12), 12 Sep 2023, Shift 2 + 1 more paper

What is the main purpose of using namespaces in programming?

  1. ATo provide data encapsulation
  2. BTo organize code into logical groups
  3. CTo define abstract classes
  4. DTo handle exceptions
Show answerHide answer

Correct answer: (B) To organize code into logical groups

Explanation

Namespaces group related classes and functions under a name, organising code logically and avoiding name clashes.

From Bihar STET Paper 2 Computer Science (Class 11-12) PYQ, 12 Sep 2023, Shift 2

This is question 57 of Bihar STET Paper 2 Computer Science (Class 11-12) PYQ, 12 Sep 2023, Shift 2. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.

Asked in 2 papers