????Java??????????????
???????????? ???????[ 2012/11/13 11:38:36 ] ????????
???????????????7#????== ???.equals
??????Java?У?????????????????????????????????==??????????????????ж???????.equals?????????????(int?? flosat?? char ??)????????????????????==?????????????????
int x = 4;
int y = 5;
if (x == y) System.out.println ("Hi");
// This ’if’ test won’t compile. if (x.equals (y)) System.out.println ("Hi");
?????????????Щ??==?????????????????????????????????equals????????????????????顣
?????????????????java.lang.Object ??????????equals????????????==???????ж????????????????????????
?????????????????equals????????????Щ??????String??????equals???????????String????????????????????????Integer??equals???????????????int????????
?????????????????????????????????????????equals?????????????????????????????????==????????
???????????????8#?????????????????????
????Java???????д32λ???????С????????????????????????????????????????????????????????д?????????????μ???????????(thread safe)???
public class Example{
private int value;
// More code here...
public void set (int x){
// NOTE: No synchronized keyword this.value = x;
}
}
?????????????????????д????????????????????
public void increment (){
// This is effectively two or three instructions:
// 1) Read current setting of ’value’.
// 2) Increment that setting.
// 3) Write the new setting back.
++this.value;
}
?????????????????????????????????????????????й???????????????????????Σ?????Щ?????????Щ?????????????????????????????????е????????????????????????????????????????????????????????????????
public synchronized void increment (){ ?? ++this.value; }
???????????????9#????catch ?????????????
?????????catch???????????????????????????
OutputStream os = null; try{
os = new OutputStream ();
// Do something with os here. ?? os.close();
}
catch (Exception e){
if (os != null) ?? os.close();
}
??????
???·???
??????????????????
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