锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美孕妇孕交黑巨大网站,国产精品人人做人人爽人人添,麻豆成人综合网http://www.aygfsteel.com/retom/archive/2012/11/23/391793.html鏅掑お闃?/dc:creator>鏅掑お闃?/author>Thu, 22 Nov 2012 22:16:00 GMThttp://www.aygfsteel.com/retom/archive/2012/11/23/391793.htmlhttp://www.aygfsteel.com/retom/comments/391793.htmlhttp://www.aygfsteel.com/retom/archive/2012/11/23/391793.html#Feedback0http://www.aygfsteel.com/retom/comments/commentRss/391793.htmlhttp://www.aygfsteel.com/retom/services/trackbacks/391793.html 1 /**
2 * 綰跨▼浜掗攣錛氱嚎紼媡d1寰楀埌obj1鐨勯攣錛岀嚎紼媡d2寰楀埌浜唎bj2鐨勯攣錛屾帴鐫錛岀嚎紼媡d1鍦ㄦ寔鏈塷bj1鐨勯攣鐨勫悓鏃?br /> 3 * 浼佸浘寰楀埌obj2鐨勯攣錛岃屾鏃剁嚎紼媡d2浠嶆寔鏈塷bj2鐨勯攣錛屾墍浠ョ嚎紼媡d1絳夊緟錛岃岀嚎紼媡d2鐨勮涓轟篃涓庣嚎紼媡d1鐩稿悓
4 * 鍥犳灝卞艦鎴愪簡姝婚攣
5 */
6 public class Client {
7 public static void main(String[] args) {
8 final Object obj1 = "test1";
9 final Object obj2 = "test2";
10
11 Thread td1 = new Thread(){
12 public void run(){
13 synchronized(obj1){
14 System.out.println("td1寰楀埌浜唎bj1鐨勯攣");
15 try {
16 Thread.sleep(1000);
17 } catch (InterruptedException e) {
18 e.printStackTrace();
19 }
20
21 synchronized(obj2){
22 System.out.println("td1浼佸浘寰楀埌obj2鐨勯攣");
23
24 try {
25 Thread.sleep(1000);
26 } catch (InterruptedException e) {
27 e.printStackTrace();
28 }
29 }
30 }
31 }
32 };
33
34
35 Thread td2 = new Thread(){
36 public void run(){
37 synchronized(obj2){
38 System.out.println("td2寰楀埌浜唎bj2鐨勯攣");
39 try {
40 Thread.sleep(1000);
41 } catch (InterruptedException e) {
42 e.printStackTrace();
43 }
44
45 synchronized(obj1){
46 System.out.println("td2浼佸浘寰楀埌obj1鐨勯攣");
47
48 try {
49 Thread.sleep(1000);
50 } catch (InterruptedException e) {
51 e.printStackTrace();
52 }
53 }
54 }
55 }
56 };
57
58 td1.start();
59 td2.start();
60 }
61
62 }

]]>- java 蹇熸帓搴?/title>http://www.aygfsteel.com/retom/archive/2012/11/01/390599.html鏅掑お闃?/dc:creator>鏅掑お闃?/author>Thu, 01 Nov 2012 04:06:00 GMThttp://www.aygfsteel.com/retom/archive/2012/11/01/390599.htmlhttp://www.aygfsteel.com/retom/comments/390599.htmlhttp://www.aygfsteel.com/retom/archive/2012/11/01/390599.html#Feedback0http://www.aygfsteel.com/retom/comments/commentRss/390599.htmlhttp://www.aygfsteel.com/retom/services/trackbacks/390599.html 1
2 public class QuickSort {
3 public static int partition(int[] arr, int low, int high){
4 int pivot = arr[low];
5 while(low<high){
6 while(low<high && arr[high]>=pivot){
7 high--;
8 }
9 if(low<high){
10 arr[low] = arr[high];
11 low++;
12 }
13
14 while(low<high && arr[low]<=pivot){
15 low++;
16 }
17 if(low<high){
18 arr[high] = arr[low];
19 high--;
20 }
21 }
22 arr[low] = pivot;
23 return low;
24 }
25
26 public static void sort(int[] arr, int low, int high){
27 int pivot;
28 if(low<high){
29 pivot = partition(arr,low,high);
30 sort(arr,low,pivot-1);
31 sort(arr,pivot+1,high);
32 }
33 }
34
35 public static void quickSort(int[] arr){
36 sort(arr,0,arr.length-1);
37 }
38
39 /*public static void main(String[] args) {
40 int[] arr = {46,34,2,99,6,23,20,8};
41 quickSort(arr);
42 StringBuilder sb = new StringBuilder();
43 for(int i=0;i<arr.length;i++){
44 sb.append(arr[i]+",");
45 }
46 sb.deleteCharAt(sb.length()-1);
47 System.out.println(sb);
48 }*/
49 }
50 
]]> - 鍏充簬instanceof鐨勭敤娉?/title>http://www.aygfsteel.com/retom/archive/2009/09/23/296103.html鏅掑お闃?/dc:creator>鏅掑お闃?/author>Wed, 23 Sep 2009 00:39:00 GMThttp://www.aygfsteel.com/retom/archive/2009/09/23/296103.htmlhttp://www.aygfsteel.com/retom/comments/296103.htmlhttp://www.aygfsteel.com/retom/archive/2009/09/23/296103.html#Feedback0http://www.aygfsteel.com/retom/comments/commentRss/296103.htmlhttp://www.aygfsteel.com/retom/services/trackbacks/296103.html
1銆?br />
1
public class IntegerTypeTest
{
2
public static void main(String[] args)
{
3
String str = "abc";
4
boolean myBoolean = (str instanceof Integer); //compile time error
5
System.out.println(myBoolean);
6
}
7
}
2銆?br />
1 import java.util.*;

public class InstanceOfDemo
{
2
3
public static void main(String[] args)
{
4
System.out.println(new InstanceOfDemo() instanceof String); //compile time error
5
System.out.println(new InstanceOfDemo() instanceof Exception); //compile time error
6
System.out.println(new InstanceOfDemo() instanceof Object); //compilation and output true
7
8
System.out.println(new InstanceOfDemo() instanceof List); //compilation and output false
9
}
10
}
11
榪欎袱涓▼搴忕殑緙栬瘧緇撴灉鍜屾垜浠鎯崇殑涓嶄竴鏍鳳紝絎竴涓▼搴忕紪璇戠粨鏋滄槸錛?br />

絎簩涓▼搴忕紪璇戠粨鏋滄槸錛?br />

浜х敓榪欑閿欒鐨勫師鍥犲湪浜庯紝instanceof榪愮畻絎︾涓涓搷浣滄暟鐨勭被鍨嬪簲璇ユ槸絎簩涓搷浣滄暟鐨勭埗綾匯佸瓙綾繪垨鑰呬笌絎簩涓搷浣滄暟鐨勭被鍨嬬浉鍚屻傚惁鍒欑紪璇戜細鍑洪敊銆?

]]>
主站蜘蛛池模板:
保定市|
阿合奇县|
和龙市|
福州市|
衡山县|
建瓯市|
天镇县|
郁南县|
肥乡县|
砚山县|
陇南市|
云龙县|
疏附县|
宣化县|
福清市|
定南县|
微山县|
邵阳县|
安福县|
启东市|
吉木萨尔县|
开阳县|
威远县|
建瓯市|
河东区|
左权县|
广安市|
昌乐县|
河北省|
八宿县|
霍林郭勒市|
葫芦岛市|
祁连县|
上犹县|
贺兰县|
安徽省|
和静县|
寿阳县|
万全县|
阿鲁科尔沁旗|
江永县|