锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美一区 二区,国产美女极品在线,国产精品一线天粉嫩avhttp://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榪愮畻絎︾涓涓搷浣滄暟鐨勭被鍨嬪簲璇ユ槸絎簩涓搷浣滄暟鐨勭埗綾匯佸瓙綾繪垨鑰呬笌絎簩涓搷浣滄暟鐨勭被鍨嬬浉鍚屻傚惁鍒欑紪璇戜細鍑洪敊銆?

]]>
主站蜘蛛池模板:
罗源县|
广昌县|
广宁县|
专栏|
长海县|
库车县|
沙坪坝区|
湘阴县|
斗六市|
绥棱县|
会昌县|
青州市|
龙岩市|
寿宁县|
珲春市|
射阳县|
德安县|
冀州市|
米泉市|
大足县|
鄂州市|
松原市|
美姑县|
金乡县|
井陉县|
射洪县|
吕梁市|
涪陵区|
买车|
景德镇市|
彰化市|
崇阳县|
英吉沙县|
安阳县|
文山县|
景谷|
阿坝|
民乐县|
石林|
石嘴山市|
开原市|