java - What should I use to store data for a program I am working on -
should use arraylist, vectors, hashmp or there else should use store data bank program working on. trying store user information in 1 of them , send file, should use? thank you.
to decide between using arraylist/vector or hashmap depends on whether have key-value pairs or simple list of elements. key-value pairs hashmap go-to option (e.g name - person object). if have objects no real keys (a list of trees in forest) arraylist or vector better.
the difference between vector , arraylist more subtle. if want more information on difference between 2 can read this article. article 2001, information isn't newest.
in cases, arraylist better choice , vector pretty considered deprecated nowadays. biggest difference between 2 is, vector synchronized while arraylist isn't, in cases, makes vector slower arraylist creates unnecessary overhead. more information can @ question: why java vector class considered obsolete or deprecated?
Comments
Post a Comment