Code example for AtomicInteger

Methods: getincrementAndGet

0
 
 
 
 
 
        AtomicInteger i=new AtomicInteger(1);
        test(i);
        System.out.println(i.get());
 
        Calendar c=Calendar.getInstance(TimeZone.getTimeZone("GMT"));
        System.out.println(c.get(Calendar.HOUR_OF_DAY));
 
    } 
    public static void test(AtomicInteger i){
        i.incrementAndGet();
        System.out.println(i.get());
    } 
 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE