Refer a friend and earn $50 when they subscribe to an annual planRefer Now
Like
Report
No Related Subtopics
01:39
Manik P.
Of the methods shown, how many different nonconstructor methods can be invoked by a SavingsAccount object? (A) 1 (B) 2 (C) 3 (D) 4 (E) 5
01:33
Ben C.
A client class has a display method that writes the time represented by its parameter: $/**$ Outputs time t in the form hrs:mins:secs. $*$ @param $t$ the time $* /$ \{ Which of the following are correct replacements for /* method body */? I Time $\mathrm{T}=$ new Time $(\mathrm{h}, \mathrm{m}, \mathrm{s})$ System.out.println(T); II System.out.println(t.hrs $+": "+t . \text { mins }+": "+t . \text { secs })$ III System.out.println(t); (A) I only (B) II only (C) III only (D) II and III only (E) I, II, and III public void display (Time t) \{ $/ *$ method body $* 1$ \}
01:01
Use the following for Questions A program to test the BankAccount, SavingsAccount, and CheckingAccount classes has these declarations: BankAccount $\mathrm{b}=$ new BankAccount (1400) ; BankAccount $s=$ new SavingsAccount (1000,0.04) ; BankAccount $c=$ new CheckingAccount (500) ; In order to test polymorphism, which method must be used in the program? (A) Either a SavingsAccount constructor or a CheckingAccount constructor (B) addInterest (C) deposit (D) withdraw (E) getBalance
02:06
Which of the following correctly implements the default constructor of the SavingsAccount class? I interestRate $=0$ super() ; II super() interestRate $=0$ III super(); (A) II only (B) I and II only (C) II and III only (D) III only (E) I, II, and III
Create your own quiz or take a quiz that has been automatically generated based on what you have been learning. Expose yourself to new questions and test your abilities with different levels of difficulty.
Create your own quiz
No transcript available
0:00