Considering the classes below, which description best represents the data fields present in an instance of class B? class A { private int i; protected int j; } class B extends A { private int k; protected int m; }

Java concepts and its programming MCQs for PPSC, FPSC, NTS, and Pakistan government job tests. Select an option below, then read the explanation.

PPSCFPSCNTSPakistan govt jobs
Subject
Java concepts and its programmingsoftware-engineering-mcqs › java-concepts-and-its-programming
Published
18 Apr 2019
Last updated
28 May 2026

Browse all Java concepts and its programming MCQs

Choose the correct answer

Explanation

Option A is correct because an object of class B inherits the protected field j from class A and also contains its own private field k and protected field m. The private field i from class A is not accessible in B, so it is not considered part of B's accessible fields.

PakQuizHub — free MCQs and past papers for Pakistan government job tests. Content is for educational practice only.