Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hi I need help answering these questions. TIPLE CHOICE QUESTIONS 1-10. (4 points each) e questions 1-4 below, use the following partial class definitions: public

hi I need help answering these questions. image text in transcribed
TIPLE CHOICE QUESTIONS 1-10. (4 points each) e questions 1-4 below, use the following partial class definitions: public class A protected int b; private int ; public void doThis) b2; C3b; System.out.println (b+", "+c); public int gets() { return b; } public class B extends Al private int d; public void do this super.do This(); // line 4 deb System.out.println b","+d); public class Tester public static void main(String[] args) A new B() a.doThis(); // line 1 71 line 2 System.out.println(a.get(); // line 3 1. Which of the following is true with respect to A, B and Tester? a. Bis a subclass of A and A is a subclass of Tester b. B is a subclass of A but A is not a superclass of B c. A is a superclass of B and Tester is not a subclass of A d. Tester and B are both subclasses of A e. None of the above 2. Which of the following data are accessible in class B? a. a, b, c, d b. b, c, d c. b, d, do This d. b, d e. None of the above 3. What is True about the lines commented as line 1, line 2, line 3, respectively, in class Tester: a. Line I will compile but line 2 will throw an exception b. Line 1 and line 2 will run and print only the values of b, and d c. Line I will not compile because type of a does not match the type of object d. Line 3 will not compile because class B does not contain a method getB()

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 3 Lnai 8726

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448440, 978-3662448441

More Books

Students also viewed these Databases questions