How to add an variable to the object name of the arraylist

Greetings,
i will like to create an object for arraylist with it name concat with a variable. This is what i mean as show below.
for i=1; i <8; i++)
ArrayList list = new ArrayList();
What i want when it loops, the arrayliost will auto create list1, list 2, list3 and so on until the for loops end. How do i add the variable i to the object name list?
Thanks

Do anyone of u mind if let me know hows the code look like?This isn't intended to be an alternative to the previous reply: in fact it's worthless unless you read the information in the link given.
import java.util.ArrayList;
import java.util.InputMismatchException;
import java.util.List;
import java.util.Random;
import java.util.Scanner;
public class ListListEg {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Random random = new Random();
            // create the mainList outside the for loop
        List<List<Integer>> mainList = new ArrayList<List<Integer>>();
        System.out.print("How many lists would you like? ");
        try {
            int num = in.nextInt();
            if(num <= 0) {
                System.out.println("Smartass!");
                System.exit(1);
                // populate the main list inside the loop
            for(int i = 0; i < num; i++) {
                mainList.add(new ArrayList<Integer>());
        } catch(InputMismatchException ime) {
            System.out.println("Idiot!");
            System.exit(1);
            // later do stuff with the lists, which you access with get()
        for(int i = 0; i < mainList.size(); i++) {
            for(int times = 0; times < 3; times++) {
                mainList.get(i).add(random.nextInt());
        System.out.println("The first list is " + mainList.get(0));
        if(mainList.size() > 1) {
            System.out.println("The second list is " + mainList.get(1));
        System.out.println("The last list is " + mainList.get(mainList.size() - 1));
}(In reality all the action would not take place in one method like this, and the exception handling would be more useful and polite.)

Similar Messages

  • How can I set the Object Name to the file name on import?

    All-
    I've been manually typing the filename into Aperture's Object Name metadata field. Is there a way to do this automatically? I use metadata presets to fill in many other fields on import but haven't found a way to set metadata fields on a file-by-file basis.
    Perhaps there's a way to do this with the thousands of images already in my library as well...
    Thanks,
    Andreas

    Here's the cleaned-up version:
    tell application "Aperture"
    set selectedImages to the selection
    repeat with i in selectedImages
    set tName to name of i
    set value of IPTC tag "ObjectName" of i to tName
    end repeat
    end tell
    Some other related bits, which you can probably work out how to put into the above script:
    Find out the AppleScript names of the IPTC tags (but only tags which have a value for that image), the names will be listed in the 'result' pane in the Script Editor:
    tell application "Aperture"
    set selectedImages to the selection
    get name of every IPTC tag of item 1 of selectedImages
    end tell
    The same for EXIF tags:
    tell application "Aperture"
    set selectedImages to the selection
    get name of every EXIF tag of item 1 of selectedImages
    end tell
    And for any custom tags you have set up. If you haven't set up any custom tags (one of my main reasons for going with Aperture) this will just return camera and picture time zones:
    tell application "Aperture"
    set selectedImages to the selection
    get name of every custom tag of item 1 of selectedImages
    end tell
    Finally, keywords:
    tell application "Aperture"
    set selectedImages to the selection
    get name of keywords of item 1 of selectedImages
    end tell
    To grab the first keyword name try 'name of keyword 1 of...' etc.
    To grab the parent keywords for hierarchical keywording stuff try experimenting with 'get parents of keywords of'. The keywords seem to be read-only from AppleScript, so a magic script that added all parent keywords doesn't seem to be possible.
    Ian

  • Using a variable in an object name.

    Hi,
    I have 15 text fields each with 6 check boxes.
    I would like to copy the text fields to new fields depending on which checkbox's are checked.
    This also needs to be in a loop.
    I need to know how to add a variable into a textfield name?
    My code is basically like this:
    var x = 1;
    while (x<15)
         {if (Page1.CheckP// insert the value of x //S1.rawValue==1)
                        {Pax// insert the vaule of x //Sect1.rawValue=PaxName1
                   x=x+1};
    I am using Adobe Designer.
    Thank you in advance.
    Damo.

    Hi Bruce,
    I am running this code in a 'on click' event on a button.
    Basically, I have 5 passenger names each with 6 CheckBox's for 6 sectors.
    If Checkbox1 (Sector 1) is checked, I want to put the passenger name in a textfield. Then look for the next passenger on sector 1 and put them in the next textfield.
    This needs to be done for each sector.
    So this is what I have:
    var PaxName1=Page1.PaxName1.rawValue;  // and all other passenger names.
    // Sector 1
    var x = 1;
    while (x<5)
         var vCheck=Page1["CheckS1P"+x];
         if (vCheck.rawValue==1)
              {[TextField"+X].rawValue = PaxName''+X;
                x=x+1};
    Hope this explains what I am trying to do.

  • TABLE / Object name of the organisational unit

    Hi,
    What's the table to found the object name of the organisationel unit (T-Code : PPOM)
    Thanks.

    Hi,
    Check T527X.
    Regards,
    Dilek

  • How to populate bind variable in view objects where clause in ADF faces

    I've got a page with 2 input items.
    The user manually enters the first value.
    On the second input item I have created a LOV for the item which opens in a popup. How do I restrict the data returned in the LOV using the value entered in the first input item. I have created a bind variable and have included it in the where clause for the view object but how do I populated it.

    Here is an example:
    Using the HR schema with the EMPLOYEES and DEPARTMENTS tables.
    Example is using ADF BC and created an EMPLOYEES entity with an updateable view object for page,
    and created a DEPARTMENTS view as a lookup
    (SQL: select department_id, department_name from departments where department_name = :DeptName)
    1: add method to the backing bean to filter the LOV
    public void getTextValueToFilterLOV(ValueChangeEvent valueChangeEvent) {
    Object value_from_form = valueChangeEvent.getNewValue();
    FacesContext fctx = FacesContext.getCurrentInstance();
    Application fapp = fctx.getApplication();
    JUFormBinding formBinding = (JUFormBinding)fapp.createValueBinding("#{bindings}").getValue(fctx);
    DCIteratorBinding dcBinding = (DCIteratorBinding)formBinding.get("DeptLOVIterator");
    ViewObject vo = dcBinding.getViewObject();
    vo.setNamedWhereClauseParam("DeptName",value_from_form);
    vo.executeQuery();
    2. add valueChangeListener to the inputText on the page with an id and autoSubmit="true"
    <af:inputText value="#{bindings.LastName.inputValue}" label="#{bindings.LastName.label}" binding="#{backing_DeptForm.inputText3}"
    id="inputText3"
    autoSubmit="true"
    valueChangeListener="#{backing_DeptForm.getTextValueToFilterLOV}">
    </af:inputText>
    3. reference the LOV with the id name on the partialTriggers property
    <af:selectOneChoice value="#{bindings.EmployeesUpdView1DepartmentId.inputValue}"
    label="#{bindings.EmployeesUpdView1DepartmentId.label}" binding="#{backing_DeptForm.selectOneChoice1}"
    id="selectOneChoice1"
    partialTriggers="inputText3">
    <f:selectItems value="#{bindings.EmployeesUpdView1DepartmentId.items}"
    binding="#{backing_DeptForm.selectItems1}"
    id="selectItems1"/>
    </af:selectOneChoice>
    Summary:
    When you entered a text (LastName), that value is passed into the backing bean method.
    The Bean method code will find the LOV Iterator and put the value into the bind variable.
    Cheers,
    Jim

  • How to add a customer field or extn coll in the tab1&2&3..of a UDO doc?

    Hi Experts,
    Does anybody know how to add a customer field or extn collection in the unused  tabs like tab1&2...in a UDO document?
    Thanks for your reply in advance.
    Thanks & Regards,
    David

    Hi Subhasini - <br><br>
    It seems you have discovered that adding an extension field to the Project Suppliers collection is not possible; many of the collections in E-Sourcing do not support extensions and, even when they do, typically, the table view of the data cannot be changed to show the extension value (it would only show on a "details" page, for example.<br><br>
    The solution that you have proposed may work, although I think there is a slight mistake in your logic. I believe you are saying that the script would take data from the newly created extension collection and populate data in the out-of-the-box vendor collection. <br><br>
    In thinking about your solution, I believe the benefit is that any logic and reporting based on the standard collection continues to function correctly (e.g., creating an RFx from the Project will use the out-of-the-box vendor collection).<br><br>
    That being said, I generally am reluctant to do a "replace" of a standard collection with an extension collection as you propose. My recommendation is that you challenge the customer on the importance of this requirement. For example, could the code be maintained on the vendor record? Why is it maintained in Projects? If it is maintained in the vendor record, could you just populate a read only collection the Projects that shows the vendor and code? Could a report be written that can be launched from within the Project to show the values? How does the customer intend to use this field? Could the display name of the vendor object be the right place for it?<br><br>
    I hope these ideas are helpful.<br><br>
    Regards,<br><br>
    Rob<br><br>

  • Webdynpro - how to add global variables and common proj to existing proj

    How to add global variable in either ViewController or CustomController.  We realise that codes must be added within the begin and end exction.  Codes outside that will be deleted when saved. 
    How can we add a common WDP project to an existing project?  We have actually added a common wdp project at the project references screen.  But during runtime, we encouter error.  The error is classNotFoundException.  The class is the class created in the common project.

    Hi.
    I think you need to assign ProB to ProA.
    Step1.
    Open propety of ProjectA.
    Step2.
    Select WebDynproRefrences
    Step3.
    Select Sharing references
    Step4.
    Choose add button.
    Step5.
    If your projectA named "testapp" and you are not using
    DC "local/testapp" is the proper name.
    I hope that it work!!!.

  • How to Add a parameter of currency exchange rate in the selection screen

    Dear Friends,
    How to Add a parameter of currency exchange rate in the selection screen with format (9999.99999). wich field i need to take.
    Thanks,
    Sridhar

    TCURR-UKURS.
    ~Suresh

  • How to add a graphic watermark that is bigger than the photo?

    How to add a graphic watermark that is bigger than the photo?
         Basically I want to add a watermark that is a border, like "outside stroke" so that it doesn't clip the photo.
         Upper, left and right side are 10px and on the bottom is my signature that is 40px high. I know how to do this in Photoshop, but can't figgure it out in Lightroom.
         The inset function with negative numbers doesn't work, because it only export to the size of the exported image, instead it should resize the image with those 10px up, left and right and 40px on      the bottom.
    My bordes look like this either one of the two can be used, and if you scroll down you will se how the end result should look like.
    And below is what it should look like, so that Lightroom doesn't clip the photo.

    Are you sure the focus of your piano roll is on the right track? Are you zoomed in/out enough?

  • How can I add the controller name in the subject of Alarm emails? PI2.1

    How can I add the controller name in the Alarm emails in PI2.1?  This would make it much easier to scan the mailbox and see what devices are affected.

    Thanx for your reply. No, although helpful, that's not what I meant. In outlook, the first line of the header contains the full username follow by a horizontal line. Under that, the default headers like To:, From:, Subject: etc follow.
    I need that firstline printed so we know instantly from which user the email was printed (the To: field often is the same name of the sender of the mail, therefor you won't know WHO printed it...).

  • How to add a port for a IP cam in the airport extreme setting? thx!

    I has buy a IP cam, but I don't know how to add a port for a IP cam in the airport extreme setting? (I can see the IP cam in local, but not the internet.) Many Thanks!

    atwoodjordan, Welcome to the discussion area!
    See Steve Newstrum's user tip "How do I use Port Mapping (Part I)". When it talks about giving your Mac a static IP address just substitute camera instead.

  • How can I get object name inside the object

    I'm trying to get the object name inside its pl/sql code to pass to another procedure, there must be a way to select object name from system tables ?
    Thanks for help

    Dear Garcia,
    Let me try to help you out..
    First of all let me confirm your requirement.. ie you want to get the attribute 'CONFIG_LINE_COL' of type cl_crm_bol_entity_col from the object 'ISUORDERITEM" right ?..
    try this code,
    data: lr_col type ref to cl_crm_bol_entity_col.
    lr_col = me->typed_context->isuorderitem->config_line_col.
    now you got the collection in lr_col variable.. you can play with this data now. I dont know whats your actual requirement so that i can help you further :).
    Hope it helps.
    Regards, Sudeep..
    Edited by: sudeep vd on Oct 2, 2008 7:31 PM

  • How to avoid the objects dependency in the packages by standard settings?

    Hi,
    How to avoid the objects dependency in the packages by standard settings?
    Example Scenario -> Our project uses two packages u2018ZZP1u2019 and u2018ZZP2u2019 for developments in the system u2018SN1u2019. We created a domain u2018ZZ_DO_TESTu2019 in the Package u2018ZZP1u2019. Now we have to make sure that the developer should not use or refer domain u2018ZZ_DO_TESTu2019 for the developments in the package u2018ZZP2u2019.
    u2026Naddy

    Evevn i felt that in the CTS at least a warning can be given if the included objects refer to any other object(s) which arre:
      1. Local Objects
      2. Locked under other requests,
      3. Lastly able to detect cyclic dependency as in we had a situation where we had a program locked in request A which calls an FM locked in request B. Now Request B refers to a message which is locked in request A.Since it was a message it gave only requrn code 4 in transport and transport ended with warnings. But if it is some other object then it is going to give compile error in at least one transport and neither can be moved without the other.
    Anyways, i will check the BAPI he has mentioned and see if any workaround can be done,
    Request: Please keep the post active until we arrive at a good solution,Thanks.

  • How do you add space between the Series Name and the chart?

    I'm trying to format a 3D pie chart and the series name is nearly unreadable depending on the angle. I would like to add some space between the series name and the chart.

    On my charts, I just select the legends and drag them away from the chart. Hopefully this example helps:
    Regards,

  • Example of generating excel dynamically in ssis? geting error [Excel Destination [190]] Error: Opening a rowset for "Excel_Destination$" failed. Check that the object exists in the database.

    example of generating excel dynamically in ssis? geting error [Excel Destination [190]] Error: Opening a rowset for "Excel_Destination$" failed. Check that the object exists in the database.

    Hi Vijay
    Can you be little bit more specific, did you receive this error when you are designing this pacakge using BIDS
    Becuase when you are designing this pacakge in BIDS, you need to manaually create a excel sheet manually for the first time you run,
    are you creating excel sheet using execute sql task and excel connection with input from a variable?
    Did you receive this error in validation phase or execution phase ?
    Can you share your query to create table in excel ?
    http://sqljunkieshare.com/2012/02/28/how-to-create-and-map-excel-destination-dynamically-in-ssis/
    Use the above post

Maybe you are looking for

  • Finder won't launch after Firmware Update

    I ran the firmware update for my MBP (MBP31.0070.B07). Now, my finder will not automatically launch upon restart/login. I can click on the Finder icon in the dock and launch the finder, but it won't do so on its own.

  • Remote print with time capsule

    Hello, I setup the time capsule so that I have access from remote over the apple-id. Connection and access to files on the time capsule works very well. Now I would like to print a document remote over the time capsule. Is it possible without direct

  • Unable to see server nodes in sap management console

    I am unable to see servernodes in sap management console. I am getting error like sapstartsrv.exe-application error , "The instruction at " 0x00000000" referenced memory at "0x00000000".The memory couldnot be "written " click on Ok to terminate the p

  • Strat routine code in transfer rules for the Extractor - 0CO_OM_CCA_1

    Dear SDNers, I have a scenario to implement a start rouine code in the transfer rulesfor the Extractor - 0CO_OM_CCA_1 , please give a light on this. Scenario: The extractor 0C0_OM_CCA_1 brings in Cost Center transactional data for costs and allocatio

  • PeopleSoft Query View

    Folks, In Application Designer, I create a record with its type Query View. Because Query View has not connected with SQL Editor in the Tool, only SQL View and Dynamic View connect with SQL Editor in which we type in SQL statement, I don't know where