How should I change from Object value to int value?

ArrayList ap = new ArrayList();
ap.add(10);
I want int value...
How should I do?
int a22 =(int)ap.get(0);
It's not working.
Help me.

This is tricky. Before 1.5, you could not do ap.add(10), you would have to do
ap.add(Integer.valueOf(10)); // OR
ap.add(new Integer(10));
This is called autoboxing and the compiler provides the extra code for you.
If you want to get it out as an int, you have to choices
1) Use generics
List<Integer> ap = new ArrayList<Integer>();
ap.add(10);
int ten = ap.get(0);2) Cast
List ap = new ArrayList();
ap.add(10);
int ten = ((Integer)ap.get(0).intValue();

Similar Messages

  • How to batch change the standard value of routing

    Dear all,
             I meet a problem, and need you help.
            As you know, we can use T-code "CS20"  to batch change a component's quantity in different Bom by a factor.
           for example:  Component a in Fert. A,  quantity change from 6g x 0.9 = 5.4g
                               Component a in Fert. B,  quantity change from 8g x 0.9 = 7.2g
           now, my question is how to Batch change the standard value in routing. (select by work center)  CA85N can select the value, but seems can not batch change by a factor,
           thanks in advance

    It is not a big task for u prasobh...Just play in CEWB for 5-10 mins you will understand everything....
    If you face any issue let me know..
    For ur information I am also an IBM employee...
    Gobi

  • TS1363 how can i change from disk modae to normal mode as none of the buttons seems to be working ?

    how can i change from disk modae to normal mode as none of the buttons seems to be working ?

    Have you tried a hard reset of the iPod yet?
    How to reset iPod
    This should take you out of disk mode and allow the iPod to boot up as it normally does.
    B-rock

  • How do i change from"offline" to "online" printing in Windows 7 for HP photosmart 5514

    how do i change from 'offline' to 'online'

    Under Printer Preferences click on See what's printing. That will open the printer's preferences dialogue box.  Select the Printer tab and then click on online. As long as there is connectivity between your PC and the printer it should then change to online.
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • Hello, when deleting emails,  how do I change from "archive" to " delete"?

    When deleting emails, how do I change from "archive" to "delete"? Thank you!

    I assume that it's a gmail account ? If you select the account on the right-hand side of Settings > Mail, Contacts, Calendars, then on the popup tap on Account and then Advanced you should be set whether emails are deleted or archived : http://support.apple.com/kb/HT4207

  • My Adobe Photoshop looks completely different.  How did it change from what I am used to using?

    My photoshop elements looks totally different from what I have been using.  How can I find the simplier version I am used to? 

    When did the version change to 10?   I used it in March and it was the one I was used to.  It was much simplier.  Is there another Adobe Photoshop besides Elements?
    ==============================
    Patti Farley - Albuquerque, NM - US
    [email protected]
    505 417 5730
    ==============================
    Date: Tue, 7 May 2013 11:22:43 -0700
    From: [email protected]
    To: [email protected]
    Subject: My Adobe Photoshop looks completely different.  How did it change from what I am used to using?
        Re: My Adobe Photoshop looks completely different.  How did it change from what I am used to using?
        created by 99jon in Photoshop Elements - View the full discussion
    Hold down the CtrlShiftAlt keys and simultaneously click on the Edit button on the welcome screen. After a few seconds release the three keys and look behind the welcome screen by closing it. Alternatively hold down the three keys whilst  clicking on the desktop icon for the Editor or PhotoshopElementsEditor.exe in the Programs folder. Keep holding down all three keys for a few seconds; then release. You should get the settings option. When you see a pop up box with the words: Delete Adobe Photoshop Elements Settings File? Click on Yes Then wait whilst Elements rebuilds the preferences.
    https://lh4.googleusercontent.com/-S6Kjmq-x08U/USJJS91-teI/AAAAAAAABIg/jpqUlTmNez4/s320/Se ttings.jpg
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5298329#5298329
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5298329#5298329
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5298329#5298329. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Photoshop Elements by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • How do I change from sync to iTunes to sync with iCloud if I don't have my computer available to plug into itubes

    How do I change from sync to iTunes to sync with iCloud if I don't have my computer available to plug into itubes

    Hello Rsd841979,
    Thanks for using Apple Support Communities.
    It's not very clear to me what you're trying to accomplish with iCloud, but if you want to start backing up to iCloud, then you can follow the directions in the article below.  If this is not what you are trying to do, then please let me know what you're wanting to use iCloud with.
    iCloud: Back up your iOS device to iCloud
    Take care,
    Alex H.

  • How can I change from useing an english keyboard to a French one

    how can I change from english to french

    Take your stylus and tap and hold on the analog clock and you will get a drop down list with two choices analog or digital. Choose digital.
    Post relates to: Centro (Sprint)

  • How can I change from a free account to a paid account?

    How can I change from a free account to a paid account?

    Tom gave you the answer to your question. 
    if you want a Paid book account, follow the process outlined in the link supplied.
    Apple iBooks store set out these requirements and they do not deviate from them for Individuals.
    You need a new email address for a new account. You need an EIN USA tax file number if you are not a US citizen or US resident. You need to submit bank and credit card details...these can be the same as your iTunes account.
    However much you find the requirements difficult, Apple do not make exceptions.

  • How do I find out if a photo in iPhoto is RGB or CMYK color?  How do I change from RGB to CMYK?

    How do I find out if a photo in iPhoto is RGB or CMYK color?  How do I change from RGB to CMYK?

    Open the file with Preview, type Command + i to bring up the Info pane and it's color mode and profile will be listed as shown here:
    To change the color mode to CMYK you'll need a 3rd party image editor like Photoshotp or GraphicConverter to do it.  Why do you need CMYK?
    OT

  • How do i change from OS-X mavericks back to mountain lion

    how do i change from OS-X mavericks back to mountain lion i dont like maverick and i want to go back to snow lion BUT I want all my stuff (pictures, docs, ect.) im running bootcamp with windows 8 also, and dont even work or load, it just keeps looping or restarting windows updates

    Here's a reference: How to revert OS X back from Mavericks: Apple Support Communities

  • How can I change from paying with a credit card to using prepaid for itunes

    How can I change from paying with a credit card to using prepaid for itunes on ipad 2 .alrwady have app ID

    iTunes Store: Changing Account Information
    http://support.apple.com/kb/HT1918
    Apple ID Support - Manage Account
    http://www.apple.com/support/appleid/manage/
     Cheers, Tom

  • HT1689 How do I change from US store to UK Store?

    How do I change from US store to UK store?

    Change App Store
    1. Tap "Settings"
    2. Tap "iTunes & App Stores"
    3.Tap "View Apple ID"
    4. Enter your user name and password.
    5. Tap "Country/Region."
    6. Tap "Change Country/Region"
    7. Select the region where you will be located.
    8. Tap "Done".

  • Why do you make it almost impossible to communicate with you? Why do new customers I have to pay half the price I am paying since years? How can I change from cloud complete to just photoshop?

    Why do you make it almost impossible to communicate with you?
    Why do new customers have to pay half the price I am paying since years?
    How can I change from cloud complete to just photoshop?
    [email protected]

    Phone support | Orders, returns exchanges
    http://helpx.adobe.com/x-productkb/global/phone-support-orders.html
    Chat support - For the link below click the Still Need Help? option in the blue area at the bottom and choose the chat option...
    Creative Cloud support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html ( http://adobe.ly/19llvMN )
    Creative Cloud pricing and membership plans | Adobe Creative Cloud
    Manage your membership and payments | Creative Cloud
    https://helpx.adobe.com/x-productkb/policy-pricing/membership-subscription-troubleshooting -creative-cloud.html

  • HT1918 How can I change from appstore us to appstore uk

    How do I change from my appstore being setup as the US store to the appstore in the UK.?

    Change iTunes Store Country on an iDevice
    1. Tap Settings;
    2. Tap iTunes & App Stores;
    3. Tap View Apple ID;
    4. Enter your user name and password;
    5. Tap Country/Region;
    6. Tap Change Country/Region;
    7. Select the region where you will be located;
    8. Tap Done.
    Also, see How to Change Your iTunes Store Account Location | eHow.com.

Maybe you are looking for

  • Service order number range creation

    Hi, Could anyone please tell me how can we create service order number range if we have done a new service order type creation, and what should we do: should we create the number range in development and then transport it to the production or we shou

  • Error:domain database does not exist

    Hi we are running Iplanet mssaging Server 5.2 p1 running in dirsync mode and iplanet directory server 5.1.We have configured th ldap settings of some of the users using the maildeliveryoption to mailbox and forward & we have set the mailforwarding at

  • Windows "Open with..." not working for Photoshop/CS5.5

    I use the "Open with..." command in the Windows right-click context menu all the time to open .jpg and other image files in Photoshop. I don't want to directly associate .jpgs, etc, to Photoshop because most of the time I just want to view them quick

  • Instead of delete trigger rows deleted

    Hi All. Im using a few instead of triggers over a view. The view selects data from other tables and merges them together. This view essentially forms the parent of a few one2one relationships with other tables. However my application doesnt know its

  • HT4009 Can I get refunds from In-App Purchase

    I download an app name Drum Master,in that app there is only 2 Drums,there is a option that cost 5.99$,called Life Pack,After that,lot of Drums were added, but none of them is the real sounds of their kind,so I was thinking can I get a refund,please