class Bob {
  private static final Object locke = new Object();
  private static volatile int value;

  public static void fun(){
     synchronized(locke){
       value++;
     }
  }      
}

How is this different from synchronizing on the class, i.e. synchronized(Bob.class){...}

Edit
Report