Getting elements out of the List

I have this code:
Vector vector = new Vector();
vector.addElement("1");
vector.addElement("2");
vector.addElement("3");
vector.addElement("4");
vector.addElement("5");
vector.addElement("6");
vector.addElement("7");
List list = vector;
Iterator iter = list.listIterator();
while( iter.hasNext()){
System.out.println("The elements is : "+iter.next());
Output: 2,3,4,5,6,7.
Why isn't the first element printed?
thanks,

works ok for me!
--p                                                                                                                                                                                                                                           

Similar Messages

  • I have a device that shows up in my airplay device list on my iMac, and my phone.  This device does not exist.  How do I get it out of the list? I would like to drop it before I add new airplay devices to my network.

    I have a device that shows up in my airplay device list in iTunes, and on my iPhone that does not exist.  How do I delete it? I have OS X 10.10.1 on my iMac, and iOS 8.1.2 on my iPhone 5.  I would like to get it out before I add new airplay devices to my network.

    I called Apple tech support.  The device turns out to be a WiFi extender.  I never would have guessed that the extender would show up on the list since I wouldn't think of it as an airplay device, and in the list, it shows a little speaker icon.  In the process of talking with Apple, I gained a greater understanding of how airplay works. 
    It turns out that there is no stored list of devices in a file on the mac, or anywhere else.  I have seen a lot of traffic on the web from people trying to modify this list, but there isn't one.  iTunes, and other devices simply poll the network for airplay devices from time to time.
    Have a very happy holiday!
    I would like to get rid of "just give me the aster, and stop wasting my time", and replace it with my name.  The Apple tech support guy never saw that before.  Just my luck.

  • How to get multiple values from the list

    I've a list of an item which I queried it from the database. I also created a button that will takes a selected items from the list when it was clicked. I used javabean to get the data from database.
    <%     // clicked on Select District Button
    Vector vselectedDistrict = new Vector();
    Vector vdistrictID = new Vector();
    String tmpSelectDistrict = "";
    tmpSelectDistrict = request.getParameter("bSelectDistrict");
    if(tmpSelectDistrict != null)
         // get multiple values from the list
         String[] selectedDistrict = request.getParameterValues("usrTDistrict");
         vselectedDistrict.clear();
         vdistrictID.clear();
         if((selectedDistrict != null) && (selectedDistrict.length != 0))
                             for(int i=0;i<selectedDistrict.length;i++)
                   vselectedDistrict.addElement(selectedDistrict);           
              vdistrictID = dbaseInfo.getcurrentDistrictID(nstate,vselectedDistrict);
              for(int i=0;i<vdistrictID.size();i++)
                   out.println("district = " + selectedDistrict[i]);                         out.println("district ID= " + vdistrictID.get(i).toString());
    %>
    // get vdistrict from the database here......
    <select name="usrTDistrict" size="5" multiple>
    <%     for(int i = 0; i< vdistrict.size(); i++)
    %>
         <option value="<%=vdistrict.get(i).toString()%>"><%=vdistrict.get(i).toString()%></option>
    <%
    %>          
    </select>
    <input type="submit" name="bSelectDistrict" value="Select District">
    Lets say the item that i selected from the list is 'Xplace' and I clicked on the Select District button,
    what I got is this error message:
    org.apache.jasper.JasperException: Unable to convert string 'Xplace' to class java.util.Vector for attribute usrTDistrict: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager
    So where is going wrong and what the message means?. Any help very much appreciated. Thanks

    These are just guesses that might hopefully steer you in directions you haven't looked in yet.
    I presume you used triangle brackets (< >) to avoid having the Jive Forum think it was the "italics" tag?
    Are you certain this: dbaseInfo.getcurrentDistrictID(nstate,vselectedDistrict);
    expects a Vector as its second parameter? And returns a Vector?
    I don't believe you've shown how you use the javabean, or its code? Perhaps it should be rewritten to accept an array of strings instead of a Vector?

  • HT4191 I have Notes that transferred to email when I set up a new email acct. They no longer appear in Notes. I can only access them in the email acct. How do I get them out of the email acct and back to the Notes app?

    I have Notes that transferred to an Email acct when I set up the acct. The Notes no longer appear in the Notes app only in the Email acct. How do I get them out of the Email acct and back to Notes? I stopped at an Apple store and they told me to copy them from the email back to Notes. But when I was in the email acct, I could not find a way to copy them. Shouldn't Notes remain in Notes unless I specifically send them somewhere else?

    Go into Settings > Mail, Contacts, Calendars, select that email account on the right-hand side of the screen and turn Notes 'on' for it - they should then appear in the Notes app instead of as an email folder in the Mail app (they will still be linked to that email account, so you may need to tap the 'Accounts' button at at the top left of the list of notes)

  • I bought the Adobe Photoshop Classroom in a Book for CS6 by accident and I have CC. I know, stupid mistake. But I can't take return the book. Is is similar enough to CC that I can still get use out of the book? Thank you so much

    I bought the Adobe Photoshop Classroom in a Book for CS6 by accident and I have CC. I know, stupid mistake. But I can't take return the book. Is is similar enough to CC that I can still get use out of the book? Thank you so much

    Each version of Adobe products builds upon the previous ones.  Some things like filters and advanced features may evolve or become deprecated over time, but the basic tools have remained pretty much the same for decades.  As long as you know there are subtle differences between versions, I think you will still get a great deal of value from C in a B for CS6.  
    Also refer to the CC online tuts
    Photoshop CC tutorials | Learn how to use Photoshop CC
    Learn Photoshop CC | Adobe TV
    Nancy O.

  • How do I store 4 hours of data and get it out of the "while loop" into a spreadshee​t file for documentin​g purposes? "See additional Text for additonal info"

    What a have is a VI that uses the following SUbvi's, starts with FP OpenVI, then FP Create TagVI, into a "While Loop" which contains a FP ReadVI outputting data into a Index ArrayVI outputting to a Display (DBL). This shows the output of a FP-AI-100 monitoring a 9v battery. I have to monitor this battery for a 4 hour period my problem is storing the 4 hours of data and getting it out of the "while loop" into a "Write to Spreadsheet File VI" all I seem to accomplish is just one data sample which I get into a spreed ship file with no problem. I just can't get 4 hours worth. By the way this is my first VI and I'm self
    trained so have mercy.

    I figured it out thanks.
    John Morris
    Glendinning Marine

  • How do I store 4 hours of data and get them out of the "while loop" into a spreadsheet file for documenting purposes? "See additional Text for additonal info"

    What a have is a VI that uses the following SUbvi's, starts with FP OPENvi, then FP Create Tagvi, into a "While Loop" which contains a FP READvi outputting data into a INDEX ARRAYvi outputting to a Display (DBL). This shows the output of a FP-AI-100 monitoring a 9v battery. I have to monitor this battery for a 4 hour period my problem is storing the 4 hours of data and getting it out of the "while loop" into a "Write to Spreadsheet File vi" all I seem to accomplish is just one data sample which I get into a spreed ship file with no problem. I just can't get 4 hours worth. By the way this is my first VI and I'm sel
    f trained so have mercy.

    I figured it out Thanks.
    John Morris
    Glendinning Marine

  • The icloud keeps asking for apple id but cannot get it out of the loop

    the icloud keeps asking for apple id but cannot get it out of the loop.  It will not let me delete or get to settings

    Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear...
    Usually takes about 15 - 20 Seconds... ( But can take Longer...)
    Release the Buttons...

  • Part of my headphones plug broke off in the port. how do i get it out? the genius bar said their tweezers would not fit

    part of my headphones plug broke off in the port. how do i get it out? the genius bar said their tweezers would not fit

    get smaller tweezers.  you need some type of small instrument.

  • I excluded iphone from controls in Keynote. How I get it back on the list to use Keynote remote?

    I excluded iphone from controls in Keynote. How I get it back on the list to use Keynote remote?

    Welcome to the Apple Community.
    If you haven't turned find my phone off on the device, it should just reappear next time it is connected to an appropriate network. If you have turned off find my phone, turn it back on.

  • HT203433 I am having trouble moving my music to my new computer. I have enable homeshare. it does not show any files in my homeshare. How do i get them out of the normal files into home share

    I am having trouble moving my music to my new computer. I have enable homeshare. it does not show any files in my homeshare. How do i get them out of the normal files into home share

    Welcome to the Apple Community.
    The following article(s) may help you.
    Moving your iTunes library to a new computer

  • HT1414 Mine keeps on saying that the device could not be restored, "an unknown error has occurred (2001)"!! Guess it's stuck in that dreaded "iPhone Recovery Mode" loop. The question is, which way out??? How do I get it out of the recovery loop??

    Mine keeps on saying that the device could not be restored, "an unknown error has occurred (2001)"!! Guess it's stuck in that dreaded "iPhone Recovery Mode" loop. The question is, which way out??? How do I get it out of the recovery loop??

    A quick Google search for Error 2001 would indicate that this occurs when you have a jailbroken phone or were trying to downgrade iOS. Is that true for you?

  • I have taken all measures to clear my iPad but still getting kicked out of the internet and sent to my home page. What next?

    I have taken all recommended measures to clear my iPad Air but, I still get kicked out of the internet. Problem seems to be more frequent as time passes

    I don't know what you mean by "all recommended measures."
    Please tell me that it has NEVER been jailbroke.  If that's the case, here are some standard repair procedures:
    First, try a system reset.  It cures many ills and it's quick, easy and harmless...
    Hold down the on/off switch and the Home button simultaneously until you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.
    If the Reset doesn't work, try a Restore.  Note that it's nowhere near as quick as a Reset.  It could take well over an hour!  Connect via cable to the computer that you use for sync.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow the on-screen directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.  Again, say "yes."
    At the end of the basic Restore, you will be asked if you wish to sync the iPad/iPod.  As before, say "yes."  Note that that sync selection will disappear and the Restore will end if you do not respond within a reasonable time.  If that happens, only the apps that are part of the IOS will appear on your device.  Corrective action is simple -  choose manual "Sync" from the bottom right of iTunes.
    If you're unable to do the Restore (or it doesn't help), go into Recovery Mode per the instructions here.  You WILL lose all of your data (game scores, etc,) but, for the most part, you can redownload apps and music without being charged again.  Also, if you have IOS-7, read this.

  • I just purchased Photoshop 11.  The serial number is not valid to get me out of the trial.

    I just purchased Photoshop 11.  The serial number is not valid to get me out of the trial.

    You need to contact Adobe Support either by chat or via phone when you have serial number and activation issues.
    Here are some links to help make contact:
    http://www.adobe.com/support/chat/ivrchat.html
    http://www.adobe.com/support/download-install/supportinfo/

  • I have been trying to work on my homework all afternoon, via NAU's blackboard system. I am continuously getting booted out of the system, with an error stating "Data execution prevention". How can I prevent this from continuing?

    I have been trying to work on my homework all afternoon, via NAU's blackboard system. I am continuously getting booted out of the system, with an error stating "Data execution prevention". How can I prevent this from continuing?

    If you are wondering why you are not getting any responses, it is because you have vented a complaint without any details that make any sense or give anyone something to work on.
    If you want help, I suggest actually detailing what has happened, with versions of software etc. Anything that would let us assist.
    As a start I am guessing that you have not really got the hang of "How it all works". Firstly download the Pages09_UserGuide.pdf from under the Help menu. Read that and view the Video Tutorials in the same place. A good addition would be the iWork 09 Missing manual book and something to help you learn how to use your Mac.
    If there are specific tasks you need help with:
    http://www.freeforum101.com/iworktipsntrick/index.php?mforum=iworktipsntrick
    Is a good resource.
    Peter

Maybe you are looking for