if we have to implementations of string split for j2me, one returns vector and the other returns array , in terms of performance on hand held devices which one is the best choice ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Arrays would always perform better than
Vector, although the difference should not be too significant. The real question is whether this performance is worth the sacrifice of not having the rich functionalities provided byVector, e.g. being dynamically growable, etc.Generally speaking you should always prefer
Listto arrays (see Effective Java 2nd Edition, Item 25, Prefer lists to arrays), but J2ME development may not give you the luxury.