How to get assing the ArrayList in a variable ?

Hi
I m new to java... I try to get the data from arraylist .. but i can't get directly..
here is the same code
ArrayList al = new al ArrayList();
al.add(new Integer(10);
int x=0;
x=a1; // This will not compile....How can i get the arralist element in another varibale.
Thank you

the last posts certainly gave you the guidance to solve the problem. This is simply an explanation of why that line containing the "does not compile" comment did not compile (I am ignoring the syntax errors in the previous lines).
You have declared x and a variable of type int. This means that x can hold whole number value from -(2^32-1) to (2^32-1) and nothing else. The variable a1has been declared as an ArrayList which contains numerous pointers to objects in memory.
When you tried to execute x = a1 you are trying to make x reference a list of data. The compiler knows that this isn't poosible so it complains.

Similar Messages

  • How to get all the values of a variable with F4 with checkboxes to select

    Dear Experts,
    After Executing a query by giving let 3 values(Out of 10 Values) to a variable.
    To give 2 more input values to the same variable(i.e.,total I wanted to give 5 inputs this time ),after refreshing the query,for that variable if I click F4, I am seeing the historical values(i.e.,3) and remaining 7 values also But with out any Check Boxes besides them to select the 2 inputs.
    In the same F4 Screen, If I click all values(an Icon at The bottom),then also Im seeing but no check Box.
    I hve tried by deleting the Delete Personalization also,but no use.
    Please tell me How to get all the values with F4 with check boxes to select ,whatever I want??
    Thanks in advance

    Take a look at the InfoObject and go to the Business Explorer tab. If the 'Query Def. Filter Value Selection' is set to 'Only Values in InfoProvider', you're only going to get the values in F4 that exist in the InfoProvider, not everything in the Master Data. This would need to be changed to the value of 'Values in Master Data Table' if you want it to show everything possible when F4 is chosen.
    Likewise, you're going to need to look at the query and go to the Advanced tab for the InfoObject. Make sure that the radio button for 'Values in Master Data Table' is selected. If not, then you should change that selection.

  • How to store the Arraylist value in variables ?

    Hi
    Here i use arraylist and i like to store all the arraylist in different variables Please tell the way .
    ArrayList list = new ArrayList();
    list.add("A");
    list.add("B");
    list.add("C");
    list.add("D");
    String a=""
    String b="";
    String c=""
    String d="";How to get and store the array list into the string variables
    Thanks & Regards
    Merlina
    Message was edited by:
    MerlinRosina

    Hai
    Thanks to your reply
    I already try this way but it throw the error "incompatible types"
    Do know any other way to store the object of arraylist into variables

  • How to get all the values from the dropdown menu

    How to get all the values from the dropdown menu
    I need to be able to extract all values from the dropdown menu; I know how to get all those values as a string, but I need to be able to access each item; (the value in a dropdown menu will change dynamically)
    How do I get number of item is selection dropdown?
    How do I extract a ?name? for each value, one by one?
    How do I change a selection by referring to particular index of the item in a dropdown menu?
    Here is the Path to dropdown menu that I'm trying to access (form contains number of similar dropdowns)
    RSWApp.om.GetElementByPath "window(index=0).form(id=""aspnetForm"" | action=""advancedsearch.aspx"" | index=0).formelement[SELECT](name=""ctl00$MainContent$hardwareBrand"" | id=""ctl00_MainContent_hardwareBrand"" | index=16)", element
    Message was edited by: testtest

    The findElement method allows various attributes to be used to search. Take the following two examples for the element below:
    <Select Name=ProdType ID=testProd>
    </Select>
    I can find the element based on its name or any other attribute, I just need to specify what I am looking for. To find it by name I would do the following:
    Set x = RSWApp.om.FindElement("ProdType","SELECT","Name")
    If I want to search by id I could do the following:
    Set x = RSWApp.om.FindElement("testProd","SELECT","ID")
    Usually you will use whatever is available. Since the select element has no name or ID on the Empirix home page, I used the onChange attribute. You can use any attribute as long as you specify which one you are using (last argument in these examples)
    You can use the FindElement to grab links, text boxes, etc.
    The next example grabs from a link on a page
    Home
    Set x = RSWApp.om.FindElement("Home","A","innerText")
    I hope this helps clear it up.

  • How to get all the values in one column of a JTable

    How to get all the values in one column of a JTable as a Collection of String.
    I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column.

    I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column. You could always write a custom TableModel that stores the data in the format you want it. It would probably be about 50 lines of code. Or you could write a loop in 3 lines of code. I'll let you decide which approach you want to take.

  • How to get all the values from a HashMap? thanks

    hi
    can anyone tell me how to get all the keys and their values contained in a HashMap? thanks

    thanks to u all for ur response, i gues if i need to get both keys and values, i need to use keySet() to get a set of keys first and then using each key to get value. is there any other faster way to get both of them (key and value)? thanks again

  • Alter a BAPI Result Table, how to get into the display "loop" ?

    Hello all,
    i have a problem regarding the result rows of a RFC/BAPI Call.
    There are three views, let's say 1,2,3. In View 1, i call a BAPI, and display the results in a table in View 2. I added a button in each row, which calls View 3 and displays some details concerning the selected row.
    I now want to store a flag for each row, that has been displayed in this way.
    In View 3 i store the key value of the displayed row in an own value node in the context.
    When i go back from View 3 to View 2, i want to see that flag (in an extra column) in every row, that has been selected in this session.
    So i do not know, how to alter a single row in the BAPI result table, how to get into the "loop" that is used by WD to display the table.
    already tried a supply function, but i was not able to alter single rows.
    Any suggestions/tips or perhaps code fragments of working supply functions ?
    Thank you !

    Hello,
    I'm not sure whether I understood your problem correctly, but I will try to give an answer.
    The easiest way I see is to copy the RFC Results to a Component Controller Context structure with an additional Flag field. You can use WDCopyService for copying.
    Then on the event of selecting you set your flag as appropriate for you (e.g. if you want to use an image as flag you set the Image path) on the current element of your table. Then display View 3.
    On going back View 2 should show now the new flag values...
    The trick is to copy the values (as at Time structures can not be expandend with new fields) and set the Flag on the onSelect event.
    Hope this helps,
    Frank

  • My mac book air can't start installation, because i use windows installation in DOS to make partion, now no mac os on it. How to get back the mac os? i have a window based iso image from a friend, because in my country there is no Apple service.

    my mac book air can't start installation, because i use windows installation in DOS to make partion, now no mac os on it. How to get back the mac os? i have a window based iso image from a friend, because in my country there is no Apple service.

    It sounds like you destroyed your boot partition and the recovery partition.  Depending on it's age, your MacBook Air might be able to do a net boot.  Plug and ethernet connection into it and attempt to boot.  If it has the right firmware, it will find a net boot configuration on the net and boot that.  Then it will give you a Recovery Partition like display and allow you to reinstall the OS X version that came with it.... assuming that it was Lion or ML.  If your computer came with Snow Leopard, then even the net boot won't work. 
    At that point you need a bootable USB Key, or an external DVD drive AND a Snow Leopard installation DVD. 
    An Apple Store, if there is one nearby, MAY be able to get you going again.  However, whatever is on the SSD now will be toast too.

  • How do I turn on my ipad, I just got it and I don't know how to get to the home screen. Also, is itunes free on the ipad

    How do I turn on my ipad, I just got it and I don't know how to get to the homescreen. Everytime I turn it on there is a black screen, the white charger, and the blue itunes circle. Also, are itunes free.?

    You must activate the iPad within iTunes on your computer. Make sure you have the latest version of iTunes on your computer (read the minimum requirements for the iPad printed on the iPad box) and connect the iPad to your computer with the supplied cable to a 2.0 USB port - not a port on a hub- a port on your computer. iTunes should start and take you through the process.
    iTunes on the iPad is a store where you purchase media - it is not the music player. The iPod app is the music player. Both apps are pre installed on the iPad.

  • How to get(copy) the contents i.e the cell of an excel sheet to other excel

    How to get(copy) the contents i.e the cells of an excel sheet to another excel sheet.
    I can read the contents i.e the text in the cells and able to display it in the Java console
    i want these contents to be copied to another excel sheet with the cells data.
    I am using Java Swing for the UI, POI framework for the excel work.
    Please anyone suggest some code to this requirement.

    [spreadsheets with poi|http://poi.apache.org/spreadsheet/converting.html] Hi
    on the poi apache site there's a number of good examples...
    I started with poi only a week ago, but just from reading these examples
    (especially SS Usermodel code) i managed all i needed to know (so far).
    kind regards
    BB
    Edited by: BugBunny on Feb 22, 2010 4:36 AM

  • How to get on the apple seeding program?

    How to get in the apple seeding program. I really want to to test apples new iOS software.

    Yes, but if you're not already a developer you shouldn't be testing beta software.
    You shouldn't test beta versions of iOS on your day-to-day phone. You should have dedicated phone just for testing and it needs to be registered with Apple.
    Being part of the developer program and having access to iOS betas is not intended for just curious, non-developer people. It is for real developers who need to test their own apps on future versions of the OS and provide detailed feedback to Apple for bug fixing.
    If you're just curious about new OSs, don't bother.

  • I never used this program before. I tapped on the "budget form" and decided I'd rather use the "expense form".  I can't figure out how to get to the page that you choose which form you want

    I never used this program before. I tapped on the "budget form" and decided I'd rather use the "expense form".  I can't figure out how to get to the page that you choose which form you want. How would I do that?

    Pct,
    In the Numbers spreadsheets window where all your documents are shown as icons, tap the Plus Sign.
    Choose Create Spreadsheet
    Select the template you want to use
    Jerry

  • How to get past the grey start up screen after mavericks update

    I have recently installed a free update of Mavericks on the App store. However after installing this, the Macbook Pro that i've installed on will not boot beyond the Grey start up screen. I was running Snow Leopard on a machine with intel core 2 duo processors 4 Gb of RAM and over 100Gb of free memory.
    I have attempted a safe boot (holding down shift while while holding the power button down), and Reseting the NVRAM by pressing 'command', 'option', 'P' and 'R' at the same time.
    I do not have an installation disk or a time machine back up.
    Does anyone know how to get passed the Grey start up Screen?
    Any Suggestions would be mucho appreciated.

    I have recently installed a free update of Mavericks on the App store. However after installing this, the Macbook Pro that i've installed on will not boot beyond the Grey start up screen. I was running Snow Leopard on a machine with intel core 2 duo processors 4 Gb of RAM and over 100Gb of free memory.
    I have attempted a safe boot (holding down shift while while holding the power button down), and Reseting the NVRAM by pressing 'command', 'option', 'P' and 'R' at the same time.
    I do not have an installation disk or a time machine back up.
    Does anyone know how to get passed the Grey start up Screen?
    Any Suggestions would be mucho appreciated.

  • Satellite 2540xcdt: How to get into the BIOS

    Hi there,
    I've just bought one of the above computers and would like to know how to get into the bios before it boots up to the OS,
    anybody out there have any ideas?
    Many thanks
    F

    Hi
    Pres ESC button just after starting the unit and keep it down for a short time.
    Bye

  • My 2y child  pressed the iphone screen many times accidently and password screen is gone. How to get  back the pwd screen ?  I have the valid pwd .

    my 2y child  pressed the iphone screen many times accidently and password screen is gone. How to get  back the pwd screen ?  I have the valid pwd.

    Reconnect it to the computer to which you last synced it.
    For more information see http://support.apple.com/kb/ht1212

Maybe you are looking for

  • How to fire event in view controller from component controller.

    I have a component usage that fires an event wich i have subscribed in the component controller.       iv_usage->subscribe_event( iv_event_name = 'TAKE_IT'                                  iv_handler = me ). After the event the method IF_BSP_WD_EVENT

  • How To register The manually Created Database into DBCA

    hi guys .. !! -:) using test linux 4 with the vmware , manually i create RAC database , the database is working proper , i planned to delete the RAC database through DBCA , but when i issued $dbca !!! the database can not be see from DBCA to delete i

  • Disable documents tab in the sales order

    Hello,    My client is having a requirement that if ship to party reference date in the purchase order data tab is entered, No user should be able to edit / delete documents attached in the documents tab of sales order.    I've tried to implement fie

  • HT1414 My iMessage isn't working right. What do I do?

    Here are some of the problems occuring: 1. I looked up how to get a number for iMessage for my iPod touch, a brand new iOS 5.1 but it says 'First make sure that your iOS whatever is running' and it showed a little example in Settings, which didn't re

  • Subcontracting Assembly Process

    Dear gurus, Just want to get guidance on the process flow of Subcontracting/Outsourcing Assembly.. Our org will still plan the requirements for the materials, inform the OEM (original equipment manufacturer), and supplying the components.. Thank you.