> -----Original Message----- > From: Snehal Pandya [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 02, 2003 11:57 AM > To: [EMAIL PROTECTED] > Subject: Use of Vector > > > Hi All, > I have a Application and For that I want to put all Master > value in the > Vector . > Whether this is good programming or it is benifishery. > My application is for intranet only. > Please help me how to use it and how to retrive the > information from the > Vector.
vector is not useful for web applications, just coz of the basic reason that it is synchronized. You could use other Collection classes or check the List interface. My 2 cents: For inserting the values use LinkedList (since LinkedList is faster for insert operations). LinkedList provides sequential access, additions and deletions, at a cost of slower random access. For retrieving or reading the values use ArrayList (ArrayList is faster for read operations). For instance, if your program is to frequently provide random access to the data of the list, (for example, "show me item three, twelve, two, and twenty-five") the ArrayList class offers quick access to individual elements of the list. When working with ArrayList and LinkedList, there are two ways of creating the objects: List cityList = new ArrayList(); LinkedList peopleList = new LinkedList(); The above creation ensures that, line 1 that we are creating an ArrayList but we are gonna use it as a List. While line 2 that, we are gonna use a linked list as a LinkedList :). > Thanks for help, > > Snehal Vikram. > > ============================================================== > ============= > To unsubscribe: mailto [EMAIL PROTECTED] with body: > "signoff JSP-INTEREST". > For digest: mailto [EMAIL PROTECTED] with body: "set > JSP-INTEREST DIGEST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://archives.java.sun.com/jsp-interest.html > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.jsp > http://www.jguru.com/faq/index.jsp > http://www.jspinsider.com > Disclaimer: This e-mail message along with any attachments is intended only for the addressee and may contain confidential and privileged information of GTL Limited. If the reader of this message is not the intended recipient, you are notified that any dissemination, distribution or copy of this communication is strictly prohibited. If you have received this message by error, please notify us immediately, return the original mail to the sender and delete the message from your system. =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com