Java SE 8 Programmer 1Z0–808 Practice Full Test 1

© examsiri.com
Question : 10 of 84
 
Marks: +1, -0
Given the code:public class CheckingAccount {
        public int amount;

        public CheckingAccount(int amount) {
                this.amount = amount;
        }

        public int getAmount() {
                return amount;
        }

        public void changeAmount(int x) {
                amount += x;
        }
}
And given the following main method, located in another class:public static void main(String[] args) {
        CheckingAccount acct = new CheckingAccount((int) (Math.random() * 1000));
        // line n1
        System.out.println(acct.getAmount());
}
Which three lines, when inserted independently at line n1, cause the program to print a 0 balance ? (Choose three.)
Go to Question: