Java?е??????????????
???????????? ???????[ 2014/4/22 9:55:02 ] ????????Java ????? ???????
????????????????????????????????????????????????????????????????????
?????????????????????????????????????κθ??????????????????????
?????????????????????????????????????????????????????????
?????????Щ??????????Щ????????????
????1???????????8????????????????
????2?????????????String?????????????
????3??Strng???????????????????????????????????
???????????????????
????Student.java
package com.tianjf;
public class Student {
private String name;
public Student??String name?? {
super????;
this.name = name;
}
public String getName???? {
return name;
}
public void setName??String name?? {
this.name = name;
}
??Override
public String toString???? {
return name;
}
}
????Test.java
package com.tianjf;
public class Test {
private static void changeInt??int i?? {
i = 1;
}
private static void changeStudent??Student student?? {
student.setName??"????"??;
}
private static void changeString??String str?? {
str = "456";
}
public static void main??String[] args?? {
int i = 0;
String str = "123";
Student student = new Student??"????"??;
System.out.println??"Before change:
i??" + i + "
" + "student:" + student.toString???? + "
" + "str:" + str??;
changeInt??i??;
changeStudent??student??;
changeString??str??;
System.out.println??"After change:
i??" + i + "
" + "student:" + student.toString???? + "
" + "str:" + str??;
}
}
???????н????
????Before change:
????i??0
????student:????
????str:123
????After change:
????i??0
????student:????
????str:123
?????????н???????????int??String??????????change????????б???student????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11