Skip to main content

Overriding And Overloading — Part 2 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Overriding And Overloading — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
10
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
12 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
10

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/10 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 10
★ FPSC ★ PPSC

What will be the output of the following Java code? class test { int a; int b; test(int i, int j) { a = i; b = j; } void meth(test o) { o.a *= 2; O.b /= 2; } } class Output { public static void main(String args[]) { test obj = new test(10 , 20); obj.meth(obj); System.out.println(obj.a + " " + obj.b); } }

Question 2 of 10
★ FPSC ★ PPSC

Which of these is correct about passing an argument by call-by-value process?

Question 3 of 10
★ FPSC ★ PPSC

What will be the output of the following Java code? class overload { int x; int y; void add(int a) { x = a + 1; } void add(int a, int b) { x = a + 2; } } class Overload_methods { public static void main(String args[]) { overload obj = new overload(); int a = 0; obj.add(6); System.out.println(obj.x); } }

Question 4 of 10
★ FPSC ★ PPSC

What will be the output of the following Java code? class overload { int x; double y; void add(int a , int b) { x = a + b; } void add(double c , double d) { y = c + d; } overload() { this.x = 0; this.y = 0; } } class Overload_methods { public static void main(String args[]) { overload obj = new overload(); int a = 2; double b = 3.2; obj.add(a, a); obj.add(b, b); System.out.println(obj.x + " " + obj.y); } }

Question 5 of 10
★ FPSC ★ PPSC

Which of these is supported by method overriding in Java?

Question 6 of 10
★ FPSC ★ PPSC

Which of this keyword can be used in a subclass to call the constructor of superclass?

Question 7 of 10
★ FPSC ★ PPSC

What will be the output of the following Java program? class Abc { public static void main(String[]args) { String[] elements = { "for", "tea", "too" }; String first = (elements.length > 0) ? elements[0]: null; } }

Question 8 of 10
★ FPSC ★ PPSC

At line number 2 in the following code, choose 3 valid data-type attributes/qualifiers among "final, static, native, public, private, abstract, protected" public interface Status { /* insert qualifier here */ int MY_VALUE = 10; }

Question 9 of 10
★ FPSC ★ PPSC

What will be the output of the following Java code? class test { int a; int b; void meth(int i , int j) { i *= 2; j /= 2; } } class Output { public static void main(String args[]) { test obj = new test(); int a = 10; int b = 20; obj.meth(a , b); System.out.println(a + " " + b); } }

Question 10 of 10
★ FPSC ★ PPSC

What will be the output of the following Java program? class A { int i; public void display() { System.out.println(i); } } class B extends A { int j; public void display() { System.out.println(j); } } class Dynamic_dispatch { public static void main(String args[]) { B obj2 = new B(); obj2.i = 1; obj2.j = 2; A r; r = obj2; r.display(); } }

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →