Question: Given: class TestTest { public static void main(String[] args) { AccountTest acct; acct = new AccountTest(1000); acct.deduct(30); ________(X)_________ } } class AccountTest { private static
Given:
class TestTest {
public static void main(String[] args) {
AccountTest acct;
acct = new AccountTest(1000);
acct.deduct(30);
________(X)_________
}
}
class AccountTest {
private static final double FEE = 10;
private double balance;
public AccountTest(double startingBalance ) {
balance = startingBalance;
}
public void deduct(double amt) {
adjust(-(amt+FEE));
}
public double getCurrentBalance( ) {
return balance;
}
private void adjust(double adjustAmt) {
balance = balance + adjustAmt;
}
}
(a) Write a statement in (X) that supposes to call method getCurrentBalance( ).
(b) Refer to the bold codes that calls another method without dot notation. Is that a valid statement?
(c) Assume the program is complete. What is the final output of the program?
oop java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
