Question: Answer Both Mcqs. They are differing questions. ckage p1: blic class A { public int code 1=5; private int code2 =6; protected double method 10

Answer Both Mcqs. They are differing questions.

Answer Both Mcqs. They are differing questions. ckage p1: blic class A

\{ public int code 1=5; private int code2 =6; protected double method

10 \{ return code2; \} f. method 1 () can be printed

ckage p1: blic class A \{ public int code 1=5; private int code2 =6; protected double method 10 \{ return code2; \} f. method 1 () can be printed None of them f.method1() can be printed, if B extends A. f.code 1 cannot be printed in B. f. code 2 can be printed in B. package p2; import p1.*; public class B{ public static void main(String[] args) \{ A f= new AO; System.out.println(f.code 1); System.out.println(f.code2); System.out.println(f.method10); \} \} 5. 15 5, 20 10,15 10,20 Compile error 5,10 None of them 15,20 15,10 5,10 None of them 10,10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!