java吧 关注:1,309,135贴子:12,888,281
  • 1回复贴,共1

求解 一道小面试题 不会耽误很长时间 想了好久

取消只看楼主收藏回复


public class Demo1 {
public static void main(String[] args) {
String str="hello";
char [] c={'h','e','l','l','o'};
Demo1 d=new Demo1();
d.exchange(str, c);
System.out.println(str+",");
System.out.println(c);}
public void exchange(String str,char []c){str="world";c[0]='q';}}
结果怎么是hello 和qello
好惆怅


1楼2013-08-28 13:02回复


    来自Android客户端3楼2013-08-28 13:41
    回复