Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Javq 45. Aside from permitting inheritance, the visibility modifier protected is alse Answer: (a) permit access to the protected item by any class detined in

Javq
image text in transcribed
image text in transcribed
45. Aside from permitting inheritance, the visibility modifier protected is alse Answer: (a) permit access to the protected item by any class detined in the sase packur (b) permit access to the protected item by any static class (e) permit access to the protected item by any parent class (d) ensure that the class can not throw a Wul1PointerExceptio 46. Java does not support multiple inheritance, but some of the abilities of maltiple inberitance are available by Answer:[ (a) importing classes (b) implementing iuterfaces (e) overriding pareat class methods (d) creating aliases Code fragment below is for Question 47 to Question Go. public claas Person ( intia("I earn sose soney-) public void etHoey (Byston.out.pr public void getMoneySystem, out, printini a retired..)a public void learn): public class Retired extends Persoa public interface Learsable peblic class Student extende Parson ieplenents Learsablef public void public void leara) (3ysten.out.printla("I go to school.:) O(Bystem out.printin(CI an on student-loam ic clasa UofTStudent extends Studest ( public void getHottol0 (Syste. out.priatin("As m a tree through the ages.")i) publie claas YorkStudest extesda Studeat t public void learn O (Systes.out printla("I go te Tork."):) pablie void gotHotto0 (Bystem.out.printla(The vay must be tried.) class Driver f pablie static vold saia (tringn arg) //teat area 47. Is it valild to replace the line of //test area in the driver cluss with Persos p ev PersonO : Answer: [ 1 (a) Yes(b) No 56. What is the output if the line of //test area in the driver elass is replaced with Student s-nev Student O: .getMoney(); Answer: (a) I earn some money. (b) I an retired. (c) I an on student-loan (d) none of above 57. What is the output if the line of //test area in the driver class is replaced with Student snew Student s.learn) Answer: (a) I go to school. (b) I go to York. (c) I go to UofT. (d) none of above 58. What is the output if the line of //test area in the driver class is replaced with Student s new YorkStudent : s.learnO; Answer: (a) I go to school. (b) I go to York. (c) I go to UofT (d) none of above 59. What is the output if the line of //teat area in the driver class is replaced with Student s new UofTStudent O; s. learnO; Answer: [ 1 (a) I go to school. (b) I go to York. (c) I go to UofT. (d) none of above area in the driver class is replaced with 60. What is the output if the line of //test YorkStudeat y - ne TorkStudentO y-getMottoO Answer: [ (a) The vay must be tried. (b) As a tree through the ages. (c) Don't know don't care. (d) none of above

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

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions