Gujarat Board, Class XII, Computer Science, Year 2023, Java Questions with Answers and Explanation
1) Which of the following keeps the data safe from unintended actions and inadvertent access by outside Objects? (A) Data Abstraction (B) Polymorphism (C) Aggregation (D) Encapsulation Answer: (D) Encapsulation Explanation: Encapsulation is a fundamental concept in object-oriented programming that involves bundling data (attributes) and the methods (functions) that operate on the data into a single unit known as a class. It helps keep the data safe from unintended actions and inadvertent access by outside objects. Encapsulation achieves this by restricting direct access to the internal details of an object and providing controlled access through well-defined interfaces (methods). 2) Which is a general concept used to embody all the common features of a particular set of objects? (A) Class (B) Behaviour (C) Attributes (D) Method Answer: (A) Class Explanation: A class is a general concept used to embody all the common features of a particular set of objects in...