Question: Question 45 Assume the method below has been added to the BankAccount class, public void transfer (BankAccount source, double amount) { balance = balance +

 Question 45 Assume the method below has been added to the
BankAccount class, public void transfer (BankAccount source, double amount) { balance =
balance + amount; source.balance = source. balance - amount; } What will

Question 45 Assume the method below has been added to the BankAccount class, public void transfer (BankAccount source, double amount) { balance = balance + amount; source.balance = source. balance - amount; } What will be output from the following statements that use the revised BankAccount class? BankAccount first = new BankAccount (100.0); BankAccount second = new BankAccount (300.0); first. transfer (second, 50.0); System.out.println (first.getBalance() + " + second.getBalance()); 100.0 300.0 150.2 250.0 150.@ 300.0 100. 250.0 00 Question 46 Assume the following variables have been declared and given values as shown: String str = "0123456789"; String sub = str.substring(3, 4); Which is the value of sub? 03 0 34 345 3456 onse, Question 47 What will be printed by the statements below? int x = 20; int y = x; X++; y-- System.out.print("X = x = 20, y = 20 X = 21, y = 20 X = 20, y = 19 X = 21, y = 19 + x + ", y = " + y)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!