Question: Show that the BankAccount(double initialBalance) constructor is not strictly nec essary. That is, if we removed that constructor from the public interface, how could a

Show that the BankAccount(double initialBalance) constructor is not strictly nec essary.

That is, if we removed that constructor from the public interface, how could a programmer still obtain BankAccount objects with an arbitrary balance?

Conversely, could we keep only the BankAccount(double initialBalance) constructor and remove the BankAccount() constructor?

Step by Step Solution

3.52 Rating (179 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Sure lets tackle this step by step First we need to understand the concept of constructors in objectoriented programming OOP specifically in Java In Java a constructor is a block of code that initiali... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!