DSSSB TGT / PGT · Computer Science

OOP Previous Year Questions (page 2)

62 OOP (Computer Science) questions asked in DSSSB TGT / PGT previous year papers, each with the correct answer and explanation. Read them free on UTpaper, or attempt the full papers as timed online tests.

  • 62 questions
  • Official answer key
  • Free

Other Computer Science topics

Q51DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)
What is the objective of encapsulation in object-oriented programming?
  1. ATo create multiple instances of a class
  2. BTo enable one class to inherit from another class
  3. CTo allow objects to take multiple forms
  4. DTo combine data and methods that operate on that data within a single unit
Show answerHide answer

Correct answer: (D) To combine data and methods that operate on that data within a single unit

Explanation

Encapsulation bundles data and the methods that act on it into one unit (class) and hides internal details. Inheritance and polymorphism are options B and C.

Q52DSSSB TGT Computer Science, 24 Jun 2023, Shift 3 (4:30 PM)
Which of the following is FALSE about packages?
  1. APackages cannot provide controlled access.
  2. BPackages are used to prevent naming conflicts.
  3. CPackages are considered data encapsulation.
  4. DPackages are used to prevent naming conflicts, and packages are considered data encapsulation.
Show answerHide answer

Correct answer: (A) Packages cannot provide controlled access.

Explanation

Packages do provide controlled access through package-private (default) and protected access. They also prevent naming conflicts and support encapsulation.

Q53DSSSB TGT Computer Science, 25 Jun 2023, Shift 3 (4:30 PM)
Which of the following is NOT a feature of object-oriented programming?
  1. AGlobal variables
  2. BFunction overloading
  3. CEncapsulation
  4. DAbstraction
Show answerHide answer

Correct answer: (A) Global variables

Explanation

Encapsulation, abstraction and polymorphism (such as function overloading) are OOP features. Global variables break encapsulation and are not an OOP feature.

Q54DSSSB TGT Computer Science, 25 Jun 2023, Shift 3 (4:30 PM)
Which object in ASP.NET provides a global storage mechanism for state data that needs to be accessible to all pages in a given web application?
  1. ASession
  2. BView state
  3. CApplication
  4. DNone of the given options
Show answerHide answer

Correct answer: (C) Application

Explanation

The Application object stores state shared by all users and pages of an ASP.NET application. Session state is per user, and ViewState is per page.

Q55DSSSB TGT Computer Science, 25 Jun 2023, Shift 3 (4:30 PM)
What is the main purpose of inheritance in object-oriented programming?
  1. AOverriding methods
  2. BAll of the given options
  3. CData hiding
  4. DCode reusability
Show answerHide answer

Correct answer: (D) Code reusability

Explanation

Inheritance lets a subclass reuse the fields and methods of an existing class, so its main purpose is code reusability.

Q56DSSSB TGT Computer Science, 25 Jun 2023, Shift 3 (4:30 PM)
What is the purpose of a software patch?
  1. ATo update the user interface of a software program
  2. BTo fix bugs or security vulnerabilities in a software program
  3. CTo add new features to a software program
  4. DTo improve the performance of a software program
Show answerHide answer

Correct answer: (B) To fix bugs or security vulnerabilities in a software program

Explanation

A software patch is an update that fixes bugs or security vulnerabilities in an existing program.

Q57DSSSB TGT Computer Science, 25 Jun 2023, Shift 2 (12:30 PM)
The ______ design is high-abstraction version of a system that is followed by ______ design that breaks the concept into less-abstracted view of sub-systems and later the ______ design showcases the implementation at module-level.
  1. Adetailed, system, architectural
  2. Bdetailed, architectural, system
  3. Carchitectural, detailed, system
  4. Dsystem, architectural, detailed
Show answerHide answer

Correct answer: (D) system, architectural, detailed

Explanation

System design gives the most abstract view of the whole system. Architectural design breaks it into sub-systems and components, and detailed design specifies each module for implementation.

Q58DSSSB TGT Computer Science, 25 Jun 2023, Shift 2 (12:30 PM)
Which of the following is a translator that translates source code into object target code?
  1. ALanguage processor
  2. BInterpreter
  3. CCompiler
  4. DAssembler
Show answerHide answer

Correct answer: (C) Compiler

Explanation

A compiler translates the whole high-level source program into object (target) code in one go. An interpreter executes line by line without producing object code, and an assembler translates only assembly language.

Q59DSSSB TGT Computer Science, 25 Jun 2023, Shift 2 (12:30 PM)
Which of the following statements is FALSE?
  1. AFinal methods can be overridden.
  2. B"static public void main(String...abcd){}" is a valid statement.
  3. CAbstract classes cannot be instantiated.
  4. DInterface allows default method definitions.
Show answerHide answer

Correct answer: (A) Final methods can be overridden.

Explanation

A final method cannot be overridden in a subclass, so (A) is false. The varargs main with modifiers in any order is valid, abstract classes cannot be instantiated, and Java 8 interfaces allow default methods.

Q60DSSSB TGT Computer Science, 25 Jun 2023, Shift 2 (12:30 PM)
In building software, should preferably be lower and is preferred to be on the higher side.
  1. Ainheritance from parent class, dependency with peer classes
  2. Baggregation with peer components, composition among classes
  3. Cnone of the given answer
  4. Dcoupling among components, cohesion in bonding components
Show answerHide answer

Correct answer: (D) coupling among components, cohesion in bonding components

Explanation

Good software design aims for low coupling (little dependency between components) and high cohesion (elements inside a component strongly related), which makes systems easier to maintain and reuse.

Q61DSSSB TGT Computer Science, 25 Jun 2023, Shift 2 (12:30 PM)
What feature of OOP allows an instance of a class to take on many forms?
  1. AOperator overriding
  2. BMultiple inheritance
  3. CNested class
  4. DOperator overloading
Show answerHide answer

Correct answer: (D) Operator overloading

Explanation

The ability to take many forms is polymorphism. Operator overloading is a form of compile-time polymorphism, where one operator behaves differently for different types, which is why it is the keyed option.

Q62DSSSB TGT Computer Science, 25 Jun 2023, Shift 2 (12:30 PM)
Which access modifier can be used to access members in deriving class?
  1. AVoid
  2. BProtected
  3. CPrivate
  4. DPublic
Show answerHide answer

Correct answer: (B) Protected

Explanation

Protected members are accessible inside the class and in classes derived from it, but not to unrelated outside code. Private members are not accessible in derived classes.

How to use these DSSSB TGT / PGT Computer Science questions

Every question here was asked in a real DSSSB TGT / PGT paper; the paper and shift are shown on the card, and the number opens the question on its own page. Try each one before tapping Show answer, then attempt the full DSSSB TGT / PGT papers as timed tests to check your speed under exam conditions.

More DSSSB TGT / PGT subjects