Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

10) If you write a class called main) do ) you create a Car object like this: led Car, but do not write a toString)

image text in transcribed
10) If you write a class called main) do ) you create a Car object like this: led Car, but do not write a toString) method. Then in Constructor exists that takes these parameter types newCar('Toyota" "Corolla, 1994, "blue"): printin("This is myCar information:+ myCar.toString()); Car mc myCar ystemout. Sy Explain what will happen and why that will happen. 11) Suppose you have a class called BankAccount that is abstract. Then you have a concrete class called SavingsAccount that extends BankAccount. BankAccount has an abstract method called withdrawFunds(double amountToWithdraw) and a non-abstract method called depositFunds(double amountToDeposit ). SavingAccount does NOT have its own version written for depositFunds(double) There are four questions here. a)ls this a valid declaration? BankAccount myAccount- new SavingsAccount() answer: b)ls this a valid declaration? SavingsAccount myAccount- new BankAccount(); answer Suppose you have this code: c) SavingsAccount myAccount = new SavingsAccount( ); myAccount.depositFunds(200); What code (from which class) will execute as a result of that method call

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

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions