Asking about Vector

Hi ,
I will like to ask about the Vector class. I tried to use the ElementAt method and when i declared the code as below :
     int arrayelement = insertarray.elementAt(tempsize);it will give me an error saying object needed.
then if i put as String as below :
String arrayelement = (String)insertarray.elementAt(tempsize); it can worked. Does this mean that for ElementAt ,we have to case it to String and not integer?? Hopw someone can enlighten me :P
Thanks

"int" is not an object, it is a primitive type. Vector can store only objects and so elementAt can return only objects; you get the error because it's impossible to get int from a general object.
If you want to store integers in the vector you can use objects of the class Integer, that class wraps the primitive type int:    insertArray.add(new Integer(42));
    Integer object = (Integer) insertArray.elementAt(0);
    int value = object.intValue();

Similar Messages

  • Ask about vector and database

    i want get data from database and save to vector. how to do?
    if anyone can provide the code
    Thank you

    maskhe wrote:
    i want get data from database JDBC tutorial:
    http://java.sun.com/docs/books/tutorial/jdbc/index.html
    and save to vector. how to do?Collections tutorial (a Vector is a collection):
    http://java.sun.com/docs/books/tutorial/collections/index.html
    if anyone can provide the codeIn the tutorials I posted is example code.
    Thank youYou're welcome.

  • I run OSX10.6.8. Just dwnlded FF8.1 and everytime I go to open it I am asked about the disk image. But if I delete the dmg, the program won't run.

    I just downloaded the 8.1 version. It was a 30+mb file. Previously I ran 4.0. So I drag the new Firefox icon into the Apps folder. It does its merge thing with the old version. Problem is when I click to open FF now, it always throws up this window asking me about the disk image of what I just downloaded. I even tried restarting the computer--but the same message pops up. I checked on your website and it says that I need to "eject" the disk image (i.e. I'm guessing that means the 30+ mb file I just down loaded), so since I don't have an eject option that I can find (except for external harddrives and cd/dvd), I just drug it into the trash. I go to empty the trash and I get a message that that dmg file is "in use" even though FF is completely shut down. So again I'm guessing that means that even though I already merged that dmg file with the old 4.0 version file, if I dump the update file it seems that it's going to mess up the actual revised program file still remaining. I just want to be able to click on the icon in my dock like I've always done and have FF open. I don't want to keep being asked about disk image stuff. Somehow this feels like an easy resolution, but I just can't seem to put my finger on how to resolve it. Thanks for you help.

    Nope---didn't work. I've owned Macs for about 12 years so although I am brain dead on some things, I do have a working knowledge on most things. I only say that to say this--I did try holding down the mouse and choosing empty trash. It asks if I want to permanently delete what's in there. I say yes--and then I get the same identical message again-----'The operation can't be completed because the item "Firefox 8.0.1.dmg" is in use I can then click stop, or continue.' So apparently that complains the same way it does if I click it up on the menu :)))
    As for item owned by---that's not an issue and isn't coming up. User is not a problem either as I am the only user on this system. There is only ONE file in my trash at the moment at that is this dmg file. Nothing Mac. Nothing owned by anyone other than Firefox. The problem seems to be that the dmg file and the original 4.0 FF file are working in tandem with each other--even though I have already drug the new 8.0 globe into the Apps folder and it updated the FF app with the new stuff. If I could force the dmg file to go away, I would do so, but at every turn the system is telling me it can't be done because it seems to think that dmg file is in use---even though everything is shut down and/or ejected. Hey--I'm getting ready to head out and won't be back till evening. I'll check back in this evening. Thank you again for your help.

  • TS1702 when I am installing a new free app on my iphone , 'm asked about the way of payment . I check the none option in my apple Id account but it wouldn't be accepted . what should I do ?

    hi , I faced with a new problem recently while installing a free app.
    when I am installing a new free app on my iphone , I'm asked about the way of payment . I check the none option in my apple Id account but it wouldn't be accepted . what should I do ?
    regards

    You need to ask Apple for assistance with getting back into your old ID. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to resolve this issue through the Account Security team, fill out and submit this form.
    (118441)

  • Hi, I asked about my WiFi modem? Sorry but I don't understand any of the suggestions given to me. We don't have an Apple Store where I live, the rest of it's over my head. I also don't own a PC. Any other suggestions? What's IPS?

    What I want to know is why did my WiFi modem work just fine for a whole week, now it doesn't. I can't get any Internet access if it's connected, if it's not I can't download apps from AppStore,as I have no Internet access. I'm tech literate, I don't understand what an IPS is, I don't know about ports and numbers, and there is no Apple store where I live. So now what am I supposed to do? My mum bought me the **** thing, it cost her $150, and it's worked for a week, and then excuse my French, **** itself! Can someone please help me, and in English please? I've only had an iPad since Christmas, I don't have a PC and wouldn't know how to do any of that stuff if I did. Very Frusterating!

    You asked about IPS. I believe you mean ISP, or your Internet Service Provider.
    Since you don't have a computer, you won't be able to change the router settings.
    Some things to try first:
    1. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    2. Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    3. Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    4. Go into your router security settings and change from WEP to WPA with AES.
    5.  Renew IP Address: (especially if you are droping internet connection)
        •    Launch Settings app
        •    Tap on Wi-Fi
        •    Tap on the blue arrow of the Wi-Fi network that you connect to from the list
        •    In the window that opens, tap on the Renew Lease button
    6. Potential Quick Fixes When Your iPad Won’t Connect to Your Wifi Network
    http://ipadinsight.com/ipad-tips-tricks/potential-quick-fixes-when-your-ipad-won t-connect-to-your-wifi-network/
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    iOS 6 Wifi Problems/Fixes
    Wi-Fi Fix for iOS 6
    https://discussions.apple.com/thread/4823738?tstart=240
    How To: Workaround iPad Wi-Fi Issues
    http://www.theipadfan.com/workaround-ipad-wifi-issues/
    Another Fix For iOS 6 WiFi Problems
    http://tabletcrunch.com/2012/10/27/fix-ios-6-wifi-problems-ssid/
    Wifi Doesn't Connect After Waking From Sleep - Sometimes increasing screen brightness prevents the failure to reconnect after waking from sleep. According to Apple, “If brightness is at lowest level, increase it by moving the slider to the right and set auto brightness to off.”
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    How to Boost Your Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Boost-Your-Wi-Fi-Signal.h tm
    Troubleshooting a Weak Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/Troubleshooting-A-Weak-Wi-Fi-Sig nal.htm
    How to Fix a Poor Wi-Fi Signal on Your iPad
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Fix-A-Poor-Wi-Fi-Signal-O n-Your-iPad.htm
    iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Connect iPad to Wi-Fi (with troubleshooting info)
    http://thehowto.wikidot.com/wifi-connect-ipad
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    How To Fix iPhone, iPad, iPod Touch Wi-Fi Connectivity Issue http://tinyurl.com/7nvxbmz
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    Wi-Fi or Bluetooth settings grayed out or dim
    http://support.apple.com/kb/TS1559
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • I have an iMac model 4,1 running OSX 10.6.8.   The CD/DVD drive went bad and I have replaced it.  However I can not get disks to eject.   I have asked about this before and tried all all the suggestions I have received but I can not eject.

    I have an iMac model 4,1 running OSX 10.6.8.   The CD/DVD drive went bad and I have replaced it.  However I can not get disks to eject.   I have asked about this before and tried all all the suggestions I have received but I can not eject.  
    Yesterday I opened up the iMac and reinstalled the drive to make sure that it was not an alignment problem.   I still can not eject.   When I try to eject the drive makes noises like it is ejecting but the disk does not come out.
    How do I solve this problem?

    Hi again Hal
    Link to your other thread > The slot loading CD/DVD drive in my...: Apple Support Communities
    You have also tried resetting the PRAM as I suggestion in your other thread...?
    See resetting the PRAM > About NVRAM and PRAM
    1. Shut down the computer.
    2. Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    3. Turn on the computer.
    4. Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    5. Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    6. Release the keys.

  • How do I create a separate Address Book? I'm not asking about a mailing list but an address book where the addresses are not mixed in with my regular address b

    How do I create a separate Address Book? I'm not asking about a mailing list but an address book where the addresses are not mixed in with my regular address book. I already have three address books created for me by Thunderbird. I add all new addresses to one of those but am afraid to delete the other address books because some of their addresses are not repeated in my "main" address book. So if I don't delete all the names in one of the existing books, I need to create an empty book that will not mix the addresses with those in another address book. HOW DO I CREATE A NEW, EMPTY ADDRESS BOOK? I want to be able to create various mailing LISTS using the addresses in this new book so I will eventually have a special address book with a variety of mailing lists I can use as I wish.

    In 24.4.0 there is no File|New|Address Book. There is File|New|Address Book Contact. How do I create a new address book ?

  • What do I have to write when in compilation form they ask about url website?

    I am trying to complete the compilation form create a sell books account. I can't go on because I don't know what do I have to write when in compilation form they ask about url website (in Physical Address and Contact Information section).
    Sorry for my english
    Thank you

    Just as the message says, she can't search places in Canada.
    Unfortunately, location based Siri searches are only supported in the U.S. for right now.  They are coming to other places such as Canada but we don't know when.

  • WTK 2.5.2 Emulator always asks about file access

    Is there a way to suppress the question that the emulator asks about accessing a file using a Fileconnection? It asks it on EVERY SINGLE ACCESS and seriously interferes with debugging. (On the real device, I can give permission once and be done with it).
    Michael D. Spence
    Mockingbird Data Systems, Inc.

    In (for Windows) C:\Documents and Settings\spence\j2mewtk\2.5.2\appdb:
    - Make a copy of _policy.txt so you can undo this later if you want.
    - Find the domain you midlet runs in (e.g., domain: identified_third_party).
    - Change these two lines:
    blanket(oneshot): read_user_data_access
    blanket(oneshot): write_user_data_access
    to read
    allow: read_user_data_access
    allow: write_user_data_access

  • HT1918 When trying to download the free applications from itunes app store its asking about billing information

    When trying to download the free applications from itunes app store its asking about billing information.
    Billing popup will display and navigating to billing detail page.

    Unless the instructions on this page are followed when creating an account : http://support.apple.com/kb/HT2534
    then credit card details will need to be entered before the account can be used to download any item (free or paid-for) from the store.
    If you are being prompted to review the account then you could see if this post by mountaingoatgirl lets you do so without needing to enter credit card details : https://discussions.apple.com/message/24303054
    If not then you will need to enter credit card details - you should be able to remove the card after entering it

  • Hi can i ask about using an ipad 2 to exchange a new ipad mini

    Hi can i ask about using an ipad 2 to exchange a new ipad mini

    Apple doesn't take trade-ins. You can a use a number of sites that take trade-ins or just give you cash for your device. One site is:
    www.gazelle.com
    There are others out there. Just Google "ipad trade-in"
    Your other option is selling your old iPad yourself.
    In any case, before you sell the device, follow the directions here to allow it to be used by the buyer as a new device.
    http://support.apple.com/kb/HT5661

  • Why asking about payment option while going in app store

    In app store i want to install Xcode its free now but its asking my Apple Id then its asking about my card details why ?? how can i install X code in my Mac mini?? Please suggest me..

    Have you used the account to purchase (even free items) before?

  • Need help about Vector class in java

    Hello,
    I have some questions about Vector class. Please see this short code:
    Vector v = new Vector();
    v.add(New Integer(5));
    Is this the only way to add int value into vector? Performance wise, is this slow? And are there any better and faster way to add/get int element fro vector?
    Thank you very much in advance.

    Normally (up to Java version 1.4), that's the only way you can add an int to a Vector. The thing is that Vector can only contain Objects, and an int is a primitive, not an object. So you have to wrap the int in an Integer object.
    However, Java 5 has a new feature, called autoboxing, which means that the compiler automatically wraps primitive values into objects, so that you can program it like this:
    Vector v = new Vector();
    v.add(5);Note, this will not make your program faster or more efficient, because the compiler translates this automatically to:
    Vector v = new Vector();
    v.add(new Integer(5));So in the end, the same bytecode will be produced. Autoboxing is just a feature to make life more convenient for the programmer.

  • My home button isn't working well so i went to my service provider to ask about the problem. They advised me to update my iPhone to iOS 5 but the problem is no matter what i do, there is always an error. What should I do?

    My home button isn't working well so i went to my service provider to ask about the problem. They advised me to update my iPhone to iOS 5 but the problem is no matter what i do, there is always an error. What should I do?

    If you are having Issues with downloading iOS 5....
    Try temporarily disabling your firewall and antivirus software and try again...
    See here for Connection Issues
    http://support.apple.com/kb/TS1379
    From Here
    http://www.apple.com/support/itunes/troubleshooting/

  • I tunes is asking about payment detail even when i am trying to download free application. Please Help

    i tunes is asking about payment detail even when i am trying to download free application. Please Help.

    Do you already have an iTunes account? You need one, even if you try to download a free App!

Maybe you are looking for

  • One of my voice memos won't sync to iTunes

    I sync my voice memos and one will not transfer. it is 1:10 minutes long, but I've synced longer ones. It is very important to be able to share with others in my group.

  • How do i change the http setting to high speed

    how do i change the http setting to high speed ???

  • BI/BW  Iview in Detailed Navigation

    Hi, I am supposed to construct a Detailed Navigation in the integrated EP7 in the new BW 3.5 : I do have a link (Bex URL) and three parameters. This is the link: http://xyz:53400/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fpla

  • Ed Husic Takes on the big software companies in Oz

    The great Photoshop non USA pricing thing seems to run out of steam here, but I Have just seen a news item about Oz MP Ed Husic taking on the likes of Adobe.  You may remember that I wrote to Ed when CS6 was released.  I had the impression that Ed ha

  • How to Locate organizational unit ?

    hi all! I am trying to assign my ZPROFILE  to my organizational unit. now the problem is i do not know that is my org unit.is there a way by which i can figure it out. any help wud be greatly appreciated. thanks sachin