java存储问题
public class testMain {
String str=new String("good");
char[] ch={'a','b','c'};
public static void main(String[] args) throws Exception{
testMain ex=new testMain();
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';
}
为什么输出是goodandgbc?
String str=new String("good");
char[] ch={'a','b','c'};
public static void main(String[] args) throws Exception{
testMain ex=new testMain();
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';
}
为什么输出是goodandgbc?
...全文
相关推荐
Java随机文件存储杂货店问题
一家杂货店的店主,需要查询、输入、修改任何意见商品的品名、价格、库存量信息。 请用随即存取文件满足其要求,可以更新,查询信息。每件商品的标志为其记录号
java_programming:这个存储库试图通过 Java 解决一些问题
这个存储库试图通过 Java 解决一些问题。 解释包的作用 white.box.collection 字符串和集合编程。 白盒反射 此代码需要 JDK 1.8。 执照 麻省理工学院执照
GFG-Java-Implementations:该存储库由来自GeeksForGeeks的问题的Java实现组成
GFG-Java实现 该存储库由来自GeeksForGeeks的问题的Java实现组成
ProblemSolving:该存储库包含在JAVA中解决的一系列问题
Skillrack每日挑战解决方案 该存储库包含JAVA中解决的一系列问题。
解决Java_Web开发中Jsp存储读取MySQL数据中文乱码的问题
解决Java_Web开发中Jsp存储读取MySQL数据中文乱码的问题



