下面的______关键字通常用来对对象加锁,该标记使得对对象的访问是排它的。
A.transient
B.synchronized
C.serialize
D.static
- · 有3位网友选择 B,占比33.33%
- · 有3位网友选择 C,占比33.33%
- · 有2位网友选择 A,占比22.22%
- · 有1位网友选择 D,占比11.11%
A.transient
B.synchronized
C.serialize
D.static
A.serialize
B.transient
C.synchronized
D.static
1)class Person {
2)public void printValue(inti, int j) {/*…*/ }
3)public void printValue(int i){/*…*/}
4)}
5)public class Teacher extends Person{
6)public void printValue() {/*…*/}
7)public void printValue(int i){/*…*/}
8)public static void main(String args[]){
9)Persorn t=new Teacher();
10)t.printValue(10);
11)}
12)}
第10行的声明将调用的方法______。
A.on line 2 B.on line 3 C.on line 6 D.on line 7
A.equals()方法判定引用值是否指向同一对象
B.==操作符判定两个分立的对象的内容和类型是否一致
C.equals()方法只有在两个对象的内容一致时返回true
D.类File重写方法equals()在两个分立的对象的内容和类型一致时返回true
A.在Java中只允许单一继承
B.在Java中一个类只能实现一个接口
C.在Java中一个类不能同时继承一个类和实现一个接口
D.Java的单一继承使代码更可靠
class Person {
private int a;
public int change(int m){return m;}
}
public class Teacher extends Person {
public int b;
public static void main(String arg[]){
Person P=new Persor();
Teacher t=new Teacher();
int i;
//point x
}
}
A.i=m; B.i=b;
C.i=p.a; D.i=p.change(30);
E.i=t.b;
A.String s="Gone with the wind";
Stringt="good";
String k=s+t;
B.String s="Gone with the wind";
String t;
t=s[3]+"one";
C.String s="Gone with the wind";
String standard=s.toUpperCase();
D.String s="home directory";
String t=s-"directory";
public class Example{
String str=new String("good");
char ch[]={'a','b','c');
public static void main(String args[]){
Example ex=new Example();
ex.change(ex.str,ex.ch);
System.out.printin(ex.str"and"ex.ch);
}
public void change(String str,char ch []){
str="test ok"; ch[0]='g';
}
)
A.good and abc B.good and gbc
C.test ok and abc D.test ok and gbc
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!