Answers for "how to make a method thread safe in java"

0

how to make a method thread safe in java

class MyCounter {
	private static int counter = 0;
 
	public static synchronized int getCount() {
		return counter++;
	}
}
Posted by: Guest on November-17-2021

Code answers related to "how to make a method thread safe in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language