package com.ttomcat;
public class ChildTask {
public static ChildTask task = null;
private int count;
private synchronized void hit(){
count++;
}
public synchronized static ChildTask getInstance(){
if(null ==task){
task =new ChildTask();
}
return task;
}
public void show(){
hit();
// synchronized(this){
// count++;
// System.out.println(count);
// }
System.out.println(count);
}
}