0
点赞
收藏
分享

微信扫一扫

一道。。Java基础面试题

冬冬_79d4 2023-03-16 阅读 116


package test;

public class ChangeValue {
String str = new String("Hello");
char[] cb = {'a', 'b', 'c'};

public void chnage(String str, char ch[]) {
str = "HelloWorld";
ch[0] = 'b';
ch[1] = 'b';
}
public static void main(String[] args) {
ChangeValue ex = new ChangeValue();
ex.chnage(ex.str,ex.cb);
System.out.println(ex.str);
System.out.println(ex.cb);
}
}

我觉得结果是 HelloWorld a,b,c

实际上是。。Hello b,b,c

一道。。Java基础面试题_System

 java基础有点废物啊。。得努力努力了

举报

相关推荐

0 条评论