@@ -0,0 +1,1435 @@
+/** %0D%0A *@functon %DF%B3%D1%A7%CF%B0 %0D%0A */  %0D%0Apackage com.multithread.runnable; %0D%0A%0D%0Aclass Data %7B%0D%0A%09private int counter = 0;%0D%0A%0D%0A%09public int getCounter() %7B%0D%0A%09%09return counter;%0D%0A%09%7D%0D%0A%0D%0A%09public void setCounter(int counter) %7B%0D%0A%09%09this.counter = counter;%0D%0A%09%7D%0D%0A%09%0D%0A%09public void incr()%7B%0D%0A%09%09this.counter++;%0D%0A%09%7D%0D%0A%7D%0D%0A%0D%0Aclass Thread2 implements Runnable%7B  %0D%0A    private String name;  %0D%0A    private Data dat;%0D%0A  %0D%0A    public Thread2(String name, Data dat) %7B  %0D%0A        this.name=name;%0D%0A        this.dat = dat;%0D%0A    %7D  %0D%0A  %0D%0A    @Override  %0D%0A    public void run() %7B  %0D%0A          for (int i = 0; i %3C 5; i++) %7B%0D%0A        %09    dat.incr();%0D%0A        %09    System.out.println(%22counter in child %22+ name+ %22 is %22+dat.getCounter());%0D%0A                System.out.println(name + %22  :  %22 + i);  %0D%0A                try %7B  %0D%0A                    Thread.sleep((int) Math.random() * 10);  %0D%0A                %7D catch (InterruptedException e) %7B  %0D%0A                    e.printStackTrace();  %0D%0A                %7D%0D%0A                %0D%0A            %7D  %0D%0A          %0D%0A    %7D  %0D%0A      %0D%0A%7D  %0D%0Apublic class Main %7B  %0D%0A  %0D%0A    public static void main(String%5B%5D args) throws InterruptedException %7B%0D%0A    %09Data dat = new Data();%0D%0A        Thread th1= new Thread(new Thread2(%22C%22, dat));%0D%0A        th1.start();%0D%0A        Thread th2 = new Thread(new Thread2(%22D%22,dat));%0D%0A        th2.start();%0D%0A        //th1.join();%0D%0A        //th2.join();%0D%0A        System.out.println(%22counter in main is%22+dat.getCounter());%0D%0A    %7D  %0D%0A  %0D%0A%7D

add runnable