Skip to main content

Paper - II (v) — Object Oriented Programming using C++ and JAVA MCQ — 45 Practice Questions with Answers

Paper - II (v) — Object Oriented Programming using C++ and JAVA is a Programming & Data Structures (Senior CI) topic in the RAS/RPSC syllabus. This page gathers exam-style Paper - II (v) — Object Oriented Programming using C++ and JAVA multiple-choice questions with correct answers and explanations, so aspirants can test recall and revise frequently examined concepts.

Practice 45 Paper - II (v) — Object Oriented Programming using C++ and JAVA multiple-choice questions with detailed answers and explanations. Ideal for RAS/RPSC exam preparation.

45 Questions Programming & Data Structures (Senior CI)

Reviewed by: Aspirant Academy Editorial Team

Practice Questions

Q1. Which statement about Java checked exceptions is correct?

A They must be either handled with a catch block or declared with throws Correct
B They are subclasses of RuntimeException and need no compile-time handling
C They must always be caught inside the same method where they occur
D They can occur only during object construction

Explanation

Java distinguishes checked exceptions from unchecked exceptions. A method that may throw a checked exception must either handle it using an appropriate catch clause or declare it using a throws clause so the obligation is visible to callers. This rule is especially relevant in file handling, where input-output operations commonly declare checked exceptions.

Q2. In C++ file handling, which class is most directly suited when the same file stream object must support both input and output operations?

A ifstream
B fstream Correct
C ofstream
D stringstream

Explanation

The C++ stream library separates common file-stream roles: ifstream for input, ofstream for output, and fstream for file streams that can support both input and output depending on the open mode. A stringstream is also a stream, but it uses an in-memory string buffer rather than a file.

Q3. In C++, a base class pointer points to a derived class object. Which declaration is essential if a call to the function through that pointer must use the derived class implementation at run time?

A Overload the function in the base class with a different parameter list.
B Declare the function as virtual in the base class and override it in the derived class. Correct
C Declare the derived class object as static before assigning its address to the pointer.
D Make the base class data members public so that the pointer can inspect them.

Explanation

C++ run-time polymorphism through a base pointer or reference depends on virtual functions. If the base class declares a member function virtual and the derived class provides a matching override, the call is dispatched according to the dynamic type of the object. Changing storage duration, data-member access, or overload sets does not create dynamic binding.

Q4. A C++ base class contains at least one pure virtual function. Which conclusion follows from this declaration?

A Objects of the base class can be created normally if every data member has a default value.
B The compiler converts the class into a Java interface at run time.
C The class becomes abstract and derived concrete classes must provide implementations for the pure virtual functions. Correct
D All member functions of the class automatically become private.

Explanation

A pure virtual function expresses an abstract operation in a C++ class. The class cannot be directly instantiated, and a derived class that is meant to be concrete must provide final implementations for all inherited pure virtual functions. This is a core way to model interface-like behavior in C++ without changing access rules or involving Java interfaces.

Q5. A C++ class Account has private data member balance. Which choice is the most appropriate object-oriented way to allow controlled modification of balance from outside the class?

A Make balance public so every function can assign to it directly.
B Store balance only in a local variable inside the constructor.
C Keep balance private and provide public member functions that validate and update it. Correct
D Declare balance as global and let all Account objects share it.

Explanation

Encapsulation keeps an object's internal representation behind a public interface. For a field such as balance, the class should retain private storage and expose operations such as deposit or withdraw that validate amounts before changing the state. This is different from simply hiding data for its own sake; the point is to protect class invariants while still allowing useful operations.

You've seen 5 of 45 sample questions

Unlimited practice on Paper - II (v) — Object Oriented Programming using C++ and JAVA comes with the RAS Test Series + Practice pack. Sign up to save progress; practice sets open with a pack or Gate Pass.

More questions (pack required)

Pack unlocks practice

Q6.

A
B
C
D
Pack unlocks practice

Q7.

A
B
C
D
Pack unlocks practice

Q8.

A
B
C
D
Pack unlocks practice

Q9.

A
B
C
D
Pack unlocks practice

Q10.

A
B
C
D
Pack unlocks practice

Q11.

A
B
C
D
Pack unlocks practice

Q12.

A
B
C
D
Pack unlocks practice

Q13.

A
B
C
D
Pack unlocks practice

Q14.

A
B
C
D
Pack unlocks practice

Q15.

A
B
C
D

40 more questions can appear in generated practice.

Frequently Asked Questions

How many Paper - II (v) — Object Oriented Programming using C++ and JAVA MCQ questions are available?
There are 45 Paper - II (v) — Object Oriented Programming using C++ and JAVA practice MCQs available on Aspirant Academy, with detailed answers and explanations for each question.
Are answers and explanations provided for Paper - II (v) — Object Oriented Programming using C++ and JAVA MCQs?
Yes, every Paper - II (v) — Object Oriented Programming using C++ and JAVA question comes with the correct answer and a detailed explanation to help you understand the underlying concept.
How is Paper - II (v) — Object Oriented Programming using C++ and JAVA relevant to the RAS/RPSC exam?
Paper - II (v) — Object Oriented Programming using C++ and JAVA falls under the Programming & Data Structures (Senior CI) section of the RAS/RPSC syllabus. It is a frequently tested area and regular practice with these MCQs will strengthen your preparation.
Can I practice Paper - II (v) — Object Oriented Programming using C++ and JAVA questions in Hindi?
Yes, Aspirant Academy offers bilingual support. You can practice Paper - II (v) — Object Oriented Programming using C++ and JAVA MCQs in both English and Hindi, including questions, options, and explanations.

More Topics in Programming & Data Structures (Senior CI)

Continue your Programming & Data Structures (Senior CI) preparation with these related topics.

Explore Other Subjects

Want unlimited practice on Paper - II (v) — Object Oriented Programming using C++ and JAVA?

Unlimited practice comes with the RAS Test Series + Practice pack. Create a free account to save progress and choose a pack or Gate Pass when you are ready.

Browse all subjects