You should always document a method by writing comments that appear 应该始终通过编写在 的注释来记录方法.
A. just before the method’s definition. 在方法定义之前
B. just after the method’s definition. 在方法定义之后
C. at the end of the file. 文件的末尾
D. only if the method is more than five lines long. 只有当方法长度超过5行时。
查看答案
When an argument value is passed to a method, the receiving parameter variable is 将参数值传递给方法时,接收参数变量为
A. declared within the body of the method 在方法体中声明
B. declared in the method header inside the parentheses 在方法头的圆括号内声明
C. declared in the calling method .在调用方法中声明
D. uses the declaration of the argument 使用参数的声明
If you attempt to use a local variable before it has been given a value, 如果你试图在局部变量被赋值之前使用它,
A. a compiler error will occur 编译器会出错
B. the local variable will always contain the value 0 局部变量总是包含值0
C. the results will be unpredictable 结果将是不可预测的
D. the local variable will be ignored 局部变量将被忽略
num = Integer.parseInt(string str) + 5;
A. num will be set to 560 num将被设置为560
B. str will have a value of “560” tr的值为“560”
C. the last line of code will cause an error 最后一行代码将导致错误
D. neither num or str will be changed num和str都不会改变
public void displayValues(double x, int y)
A. displayValue(a,b); // where a is a long and b is a byte a为long型,b为byte型
B. displayValue(a,b); // where a is an int and b is a byte a为int型,b为byte型
C. displayValue(a,b); // where a is a short and b is a long a为short型,b为long型
D. 以上给定的值都是错误的