Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

synchronized block java

public class MyCounter {

  private int count = 0;

  public synchronized void add(int value){
      this.count += value;
  }
}
Source by tutorials.jenkov.com #
 
PREVIOUS NEXT
Tagged: #synchronized #block #java
ADD COMMENT
Topic
Name
3+9 =