Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

6th International Edition

061921323X, 978-0619213237

More Books

Students also viewed these Databases questions

Question

Star River Electronics Ltd. Case of study 26 Solution

Answered: 1 week ago

Question

Distinguish between hearing and listening.

Answered: 1 week ago

Question

Use your voice effectively.

Answered: 1 week ago