Finish a method

Report a typo

Finish the makeThreadLocal method:

  • Create a ThreadLocal instance;

  • Set its value to counter + 1;

  • Return ThreadLocal.

Write a program in Java 17
class UseThreadLocal {
public static ThreadLocal<Integer> makeThreadLocal(int counter) {
// write your code here
}
}
___

Create a free account to access the full topic