Refer a friend and earn $50 when they subscribe to an annual planRefer Now
Like
Report
No Related Subtopics
01:46
Manik P.
Consider the following hierarchy of classes: A program is written to print data about various birds: Assuming that none of the given classes is abstract and all have default constructors, which of the following segments of $/ * more code */ $will not cause an error? (A) printName(parrot2); printBirdCall((Parrot) bird2); (B) printName((Parrot) bird1); printBirdcall(bird2); (C) printName(bird2); printBirdcall(bird2); (D) printName((Parakeet) parrot1); printBirdcall(parrot2); (E) printName((Ow1) parrot2); printBirdcall((Parakeet) parrot2);
00:40
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) ; Which method call will cause an error? (A) b.deposit(200) ; (B) s.withdraw(500); (C) c.withdraw(500); (D) s. deposit(10000) ; (E) s.addInterest() ;
01:29
A new method is added to the BankAccount class. Which of the following will transfer money from one account to another without error? I b.transfer(timssavings, 50); II timssavings.transfer (daynaschecking, 30); III daynasChecking.transfer(b, 55); (A) I only (B) II only (C) III only (D) I, II, and III (E) None
01:30
Use the declarations below for Questions. A program that tests these classes has the following declarations and assignments: How many of the above lines of code are incorrect? (A) 0 (B) 1 (C) 2 (D) 3 (E) 4
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