题目内容

Given the following code, what will be the value of finalAmount when it is displayed?给定以下代码,finalAmount在显示时的值是多少?public class Order{private int orderNum;private double orderAmount;private double orderDiscount;public Order(int orderNumber, double orderAmt,double orderDisc){orderNum = orderNumber;orderAmount = orderAmt;orderDiscount = orderDisc;}public double finalOrderTotal(){return orderAmount - orderAmount *orderDiscount;}}public class CustomerOrder{public static void main(String[] args){Order order;int orderNumber = 1234;double orderAmt = 580.00;double orderDisc = .1;order = new Order(orderNumber, orderAmt, orderDisc);double finalAmount = order.finalOrderTotal();System.out.println("Final order amount = $" +finalAmount);}}

A. 528.00
B. 580.00
C. 522.00
D. There is no value because the object order has not been created.没有值,因为没有创建对象顺序

查看答案
更多问题

The following package is automatically imported into all Java programs.

A. 的哪个包被自动导入到所有Java程序中。
B. java.java
C. java.default
D. java.util
E. java.lang

Look at the following statement.看看下面的句子import java.util.*;This is an example of: 这是一个的例子

A. a wildcard import 通配符导入
B. an explicit import 显式导入
C. unconditional import 无条件导入
D. conditional import 有条件导入

Any method that calls a method with a throws clause in its header must 任何在其头中调用带有抛出子函数的方法都必须

A. handle the potential exception 处理潜在的异常
B. have the same throws clause 有相同的抛出条款
C. Both of the above 以上两项都是
D. do nothing, the called program will take care of the throws clause 什么也不做,被调用的程序将处理子函数抛出的异常

The process of breaking a problem down into smaller pieces is sometimes called将问题分解成更小的部分的过程有时被称为

A. divide and conquer 分而治之
B. scientific method 科学方法
C. top-down programming 自上而下的编程
D. whole-into-part 从整体到部分

答案查题题库