Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started