Methods that operate on an object's fields are called:操作于对象域中的方法被称为:
A. instance variables 实例变量
B. instance methods .实例方法
C. public methods 公共方法
D. private methods 私有方法
查看答案
The scope of a private instance field is:私有实例字段的范围是:
A. the instance methods of the same class 同一个类的实例方法
B. inside the class, but not inside any method 在类中,但不在任何方法中
C. inside the parentheses of a method header 方法头的括号内
D. the method in which they are defined 定义它们的方法
A constructor:构造函数:
A. always accepts two arguments 总是接收两个参数
B. has return type of void 返回类型为void
C. has the same name as the class 具有与类相同的名称
D. always has an access specifier of private 总是有一个私有的访问说明符
Which of the following statements will create a reference, str, to the String, “Hello, World”?哪个语句将创建对字符串“Hello, World”的引用str ?
A. String str = "Hello, World";
B. string str = "Hello, World";
C. String str = new "Hello, World";
D. str = "Hello, World";
Two or more methods in a class may have the same name as long as:类中的两个或多个方法可能具有相同的名称,只要:
A. they have different return types 它们有不同的返回类型
B. they have different parameter lists 它们有不同的参数集合
C. they have different return types, but the same parameter list 它们有不同的返回类型,但是相同的参数列集合
D. you cannot have two methods with the same name 你不能有两个同名的方法