Read object from file in java -


i have class has method generate id incrementally created objects , add vector ,then save .dat file read file , add objects vector but, when open program again create objects, starts initial id, doesn't continue last id. solution this?

you using counter-like id generator , starting id being initialized during startup. 2 ways:

  1. store last index used in file load first retrieve , continue sequence
  2. using such ids not considered good, if want uuid (universally unique ids) java provides class such java.util.uuid.

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -