我们这一家

2013年7月10日

Java - 同步与锁

摘要: package cn.itcast;import java.util.Stack;class Foo{ private int x=100; public int getX(){ return x; } public int fix(int y){ x=x-y; return x; }}public class Test01 extends Thread { private Foo foo = new Foo(); public static void main(String[] args) {... 阅读全文

posted @ 2013-07-10 23:00 MaxNumber 阅读(199) 评论(0) 推荐(0) 编辑

Java - 多线程

摘要: 1 package cn.itcast; 2 3 import java.util.Stack; 4 5 class DoSomething implements Runnable { 6 private String name; 7 8 public DoSomething(String name) { 9 this.name = name;10 }11 12 public void run() {13 // TODO Auto-generated method stub14 for(int i=0;i<... 阅读全文

posted @ 2013-07-10 21:42 MaxNumber 阅读(181) 评论(0) 推荐(0) 编辑

导航

Loading...........