17 OOP (Computer Science) questions asked in BPSC TRE previous year papers, each with the correct answer and explanation. Read them free on UTpaper, or attempt the full papers as timed online tests.
What difference do the fifth generation computers have from other generation computers?
ATechnological advancement
BObject-oriented programming
CScientific code
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (D) More than one of the above
Explanation
Fifth-generation computers are marked both by technological advancement (AI, parallel processing) and by object-oriented programming, so more than one option applies.
Which of the following statements is completely true?
I. In an object-oriented programming language, all the function calls are resolved at compile-time.
II. In a procedure programming language, all the function calls are resolved at compile-time.
AOnly II
BOnly I
CBoth I and II
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) Only II
Explanation
Object-oriented languages also use run-time (virtual) binding, so I is false; in procedural languages every call is resolved at compile time, so only II is true.
How can one implement the compile-time polymorphism in the C++ programming language?
ABy using the template
BBy using the concepts of inheritance
CBy using both the virtual functions and inheritance
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) By using the template
Explanation
Templates (along with overloading) are resolved at compile time, so they implement compile-time polymorphism; virtual functions give run-time polymorphism.
Among the following, which statement is correct about the modularity?
AModularity means hiding the parts of the program.
BModularity refers to dividing a program into subsequent small modules or independent parts.
CIt refers to overloading the program's part.
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) Modularity refers to dividing a program into subsequent small modules or independent parts.
Explanation
Modularity means splitting a program into small independent modules.
Q7BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is a pillar of OOP?
AInheritance
BEncapsulation
CAbstraction
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (D) More than one of the above
Explanation
Inheritance, encapsulation and abstraction, along with polymorphism, are the pillars of OOP, so more than one option is correct.
Q8BPSC TRE 3.0 (2024) Computer Science Class 11-12
What is the access specifier used to make members of a class accessible only within the same package?
Aprivate
Bpublic
Cpackage-private
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) package-private
Explanation
Java's default (package-private) access, with no modifier at all, makes a member visible only to classes in the same package.
Q9BPSC TRE 3.0 (2024) Computer Science Class 11-12
Inheritance in OOP allows a class to:
AInherit properties and behavior from another class
BCreate instances of another class
COverride methods of another class
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) Inherit properties and behavior from another class
Explanation
Inheritance lets a class acquire the properties (fields) and behaviour (methods) of another class. Overriding is a separate feature that inheritance makes possible.
Q10BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following features must be supported by any programming language to become a pure object-oriented programming language?
AEncapsulation
BInheritance
CPolymorphism
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (D) More than one of the above
Explanation
A pure object-oriented language must support encapsulation, inheritance and polymorphism (along with abstraction and objects), so all three are required.
Q11BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which is correct syntax of inheritance?
Aclass base_classname : access derived_classname {/*define class body*/};
Bclass derived_classname : access base_classname {/*define class body*/};
Cclass derived_classname : base_classname {/*define class body*/};
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (D) More than one of the above
Explanation
Both (B) and (C) are valid: class derived : access base { }; and, without an access specifier, class derived : base { }; where the default is private for classes.
Q12BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following statements is correct about the class?
AAn object is an instance of its class.
BA class is an instance of its object.
CAn object is the instance of the data type of that class.
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) An object is an instance of its class.
Explanation
A class is a blueprint, and an object is an instance of its class. The reverse statement is wrong.
Q13BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following can be used to create an abstract class in the C++ programming language?
ABy using the pure virtual function in the class
BBy declaring a virtual function in the base class
CBy declaring the virtual keyword afterward the class declaration
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) By using the pure virtual function in the class
Explanation
A class becomes abstract when it has at least one pure virtual function, for example virtual void f() = 0;. Such a class cannot be instantiated.
Q14BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which feature of OOP is indicated by the following code?
class student{int marks;};
class topper: public student{int age;
topper(int age) {this.age=age;}};
AEncapsulation and inheritance
BInheritance and polymorphism
CPolymorphism
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) Encapsulation and inheritance
Explanation
Data hidden inside the classes shows encapsulation, and topper deriving from student with public shows inheritance. There is no overloading or overriding, so polymorphism is not shown.
Q15BPSC TRE 2.0 (2023) Computer Science Class 11-12
A constructor is called whenever
Aan object is created
Ba class is created
Ca class is declared
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) an object is created
Explanation
A constructor runs automatically each time an object of the class is created, and it initialises that object. Declaring a class does not call it.
Q16BPSC TRE 2.0 (2023) Computer Science Class 11-12
The number of access specifiers in class of C++ is
A2
B3
C4
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) 3
Explanation
C++ has three access specifiers: public, private and protected.
Q17BPSC TRE 2.0 (2023) Computer Science Class 11-12
Which concept of C++ is used to reuse the written code?
APolymorphism
BInheritance
CEncapsulation
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) Inheritance
Explanation
Inheritance lets a derived class reuse the data and functions of an existing base class without rewriting them.
How to use these BPSC TRE Computer Science questions
Every question here was asked in a real BPSC TRE 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 BPSC TRE papers as timed tests to check your speed under exam conditions.