w*********n 发帖数: 439 | 1 What happens when these statements are compiled?
Loan loan = new Loan(amount, months);
Object obj = loan;
obj.calculatePayments();
Answer
a.
A compile-time error occurs because the Object object can’t invoke the
calculatePayments method
b.
A compile-time error occurs because the Object object can’t reference a
Loan object without a cast
c.
These statements will compile without errors |
Y**G 发帖数: 1089 | 2 当这里是幼儿园?问点有内涵的问题吧
【在 w*********n 的大作中提到】 : What happens when these statements are compiled? : Loan loan = new Loan(amount, months); : Object obj = loan; : obj.calculatePayments(); : Answer : a. : A compile-time error occurs because the Object object can’t invoke the : calculatePayments method : b. : A compile-time error occurs because the Object object can’t reference a
|
w*********n 发帖数: 439 | |
a****i 发帖数: 1182 | 4 kid, try this:
http://stackoverflow.com/questions/how-to-ask
【在 w*********n 的大作中提到】 : 大虾,小弟我初学java。就让我当一次幼儿吧
|
d*j 发帖数: 756 | 5 建议先把语言系统的学习一遍,很有必要的。都是这么过来的。不要想一本书都不看,
用的时候找答案。系统的学习。
【在 w*********n 的大作中提到】 : What happens when these statements are compiled? : Loan loan = new Loan(amount, months); : Object obj = loan; : obj.calculatePayments(); : Answer : a. : A compile-time error occurs because the Object object can’t invoke the : calculatePayments method : b. : A compile-time error occurs because the Object object can’t reference a
|