请看看下面两道Java题,选择哪个答案,并请说明原因!
1.指出正确的表达式().
A. byte = 128;
B. Boolean = null;
C. long l = 0xfffL;
D. double = 0.9239d;
2.指出下列程序运行的结果
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.print(ex.str+" and ");
System.out.print(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
人气:100 ℃ 时间:2020-10-02 02:17:29
解答
1.C答案A 超出了范围 bye的取值范围是-128-127 答案B boolean行只有两种取值true和false没有null 答案D 没有变量名2.B 因为字符串作为参数传递的时候,其实传递的是一个字符串的副本,所以对字符串的修...
推荐
- 题目是这样的:
- 已知M是∠AOB内的一点,满足点M到OA,OB的两边的距离MC,MD相等,做射线OM,在射线OM上取一点P,连接PC,PD,找
- continuous-shot是什么意思
- √25+x² -√15+x²=4,求√25+x² +√15+x²的值
- 似字的拼音和能组什么词
- 中国的哲学源头在何处?
- 7.02立方分米=()升=()毫升
- {an} 的各项均为正数,a1 = 3 ,前 n 项和为 Sn ,{bn} 为等比数列,b1 = 1 且 b2*s2 = 64 ,b3*s3 = 960.
猜你喜欢