Generate sequential number on different objects java -


i'm trying make class "prepaid card" , need card sequential , unique id. how can compare id of 1 card want create others created?

you can maybe use static atomiclong ?

public class prepaidcard {    private static final atomiclong ref = new atomiclong();   private final long counter;    public prepaidcard() {     counter = ref.incrementandget();   } } 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -