03 2012 档案
Android学习资源
摘要:这里没有华丽的UI,有的只是最实用的技术教学视频这里没有森严的用户等级,有的只是众生平等的讨论环境这里没有指点江山、激扬文字的牛人,有的只是谦虚谨慎、戒骄戒躁的程序员这里没有华丽的UI,有的只是最实用的技术教学视频这里没有森严的用户等级,有的只是众生平等的讨论环境这里没有指点江山、激扬文字的牛人,有的只是谦虚谨慎、戒骄戒躁的程序员http://www.mars-droid.com/ 阅读全文
posted @ 2012-03-20 06:22 平安夜 阅读(138) 评论(0) 推荐(0)
对象实例化过程
摘要:class Person{public String name="unknown";public int age=-1;public Person(){}public Person(String name,int age){this.name=name;this.age=age;}public void getInfo(){System.out.println("Name="+name+":"+"Age="+age);}}//定义新类增加了自己专有的属性与方法,继承父类的方法,扩展了父类//简化对类的定义class 阅读全文
posted @ 2012-03-14 07:03 平安夜 阅读(164) 评论(0) 推荐(0)
通知与等待
摘要:class Producer implements Runnable{Q q;Producer(Q q){this.q=q;}public void run(){int i=0;while(true){synchronized(q){if(q.bFull)try{q.wait();}catch(Exception e){}if(i==0){q.name="Zhangsan";try{Thread.sleep(1);}catch(Exception e){}q.sex="male";}else{q.name="Lisi";q.sex=& 阅读全文
posted @ 2012-03-10 08:31 平安夜 阅读(132) 评论(0) 推荐(0)
生产者与消费者
摘要:class Producer implements Runnable{Q q;Producer(Q q){this.q=q;}public void run(){int i=0;while(true){synchronized(q){if(i==0){q.name="Zhangsan";try{Thread.sleep(1);}catch(Exception e){}q.sex="male";}else{q.name="Lisi";q.sex="female";}}i=(i+1)%2;}}}class Consum 阅读全文
posted @ 2012-03-10 08:04 平安夜 阅读(107) 评论(0) 推荐(0)
死锁
摘要:class ThreadDemo1{public static void main(String[] args){TestThread tt =new TestThread();new Thread(tt).start();try{Thread.sleep(1);}catch(Exception e){}tt.str=new String("method");new Thread(tt).start();}}class TestThread implements Runnable{String str=new String("");int tickets 阅读全文
posted @ 2012-03-09 08:47 平安夜 阅读(146) 评论(0) 推荐(0)
同步代码块与同步方法
摘要:class ThreadDemo1{public static void main(String[] args){TestThread tt =new TestThread();new Thread(tt).start();try{Thread.sleep(1);}catch(Exception e){}tt.str=new String("method");new Thread(tt).start();}}class TestThread implements Runnable{String str=new String("");int tickets 阅读全文
posted @ 2012-03-09 08:38 平安夜 阅读(218) 评论(0) 推荐(0)
同步函数
摘要:class ThreadDemo1{public static void main(String[] args){TestThread tt=new TestThread();new Thread(tt).start();new Thread(tt).start();new Thread(tt).start();new Thread(tt).start();}}class TestThread implements Runnable{String str=new String("");int tickets=100;public void run(){while(true) 阅读全文
posted @ 2012-03-09 07:16 平安夜 阅读(113) 评论(0) 推荐(0)
关于移动硬盘或U盘数据丢失恢复工具
摘要:有这么一个工具SuperRecovery可以恢复被删除或者格式化后的数据,移动硬盘80G数据被格式化后几乎100%找回来了,支持多种格式,RAR,ZIP,RMVB,OFFICE等文件类型;(在使用时可以用破解版)类似的工具还有EasyRecovery,RecoverMyFile,FinalData等 阅读全文
posted @ 2012-03-08 07:12 平安夜 阅读(154) 评论(0) 推荐(0)
同步代码块
摘要:class Test{public static void main(String[] args){TestThread tt =new TestThread();for(int i=0;i<5;i++){new Thread(tt).start();}}class TestThread implements Runnable{int tickets =100;String str =new String("");public void run(){while(true){synchronized(str){if(tickets>0){try{Thread.sl 阅读全文
posted @ 2012-03-02 08:56 平安夜 阅读(119) 评论(0) 推荐(0)
线程同步
摘要:同步代码快,同步函数是以牺牲性能来换取程序安全的string str =new string("");while(true){synchronized(str){if(t>0){try{System.out.println(":"+t--);}catch(Exception e){}}}} 阅读全文
posted @ 2012-03-01 08:52 平安夜 阅读(108) 评论(0) 推荐(0)