How to Increment a class Integer references value in java from another method

后端 未结 10 608
攒了一身酷
攒了一身酷 2020-12-09 02:29
package myintergertest;

/**
 *
 * @author Engineering
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void          


        
10条回答
  •  独厮守ぢ
    2020-12-09 03:19

    See AtomicInteger: http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicInteger.html

    You can do it thread-safe using this java.util.concurrent class.

提交回复
热议问题