Strings are constant; their values cannot be changed after they are created.
解决方案 »
- 求指教,该程序为什么返回false?怎么改才会返回true
- 打印出2--1000的完全数
- RandomAccessFile用 writeUTF() 写文件的时候为什么第一个字符会是乱码?
- 在Java FileWrite的那个方法可把内容续到一个文件中,而不是覆盖原有的???
- 怎样分别调度两个进程
- 怪事情啊.高手进来
- 怎么在linux环境下安装J2SE或者是J2EE
- 谁能给我一个模拟控制电梯运行的源程序
- 把5000多个文件,大约100兆,写入ZipOutputStream,出现Out of Memory,怎么办?
- java分布式架构一般使用什么技术?
- java桌面程序想要上传文件如何实现呢?
- 这个错误是什么意思:java.sql.SQLException: ORA-01008: 并非所有变量都已关联;
public int MyEncrypt(String str,int num){
str="ok";
}
main(){
String temp = "mystr";
MyEncrypt(temp);
System.out.println(temp);//temp还是mystr
}
{
public void MyEncrypt(String str)
{
str="ok";
}
public static void main(String[] args)
{
String temp = "mystr";
new SYH().MyEncrypt(temp);
System.out.println(temp);//temp还是mystr
}
}
{
String s="111";
public static void main(String[] args)
{
SYH syh=new SYH();
syh.change("222"); System.out.println(syh.s);
}
public void change(String str)
{
this.s=str;
}
}