Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: List of Objects to String array

  1. #1
    padam is offline Member
    Join Date
    May 2012
    Posts
    1
    Rep Power
    0

    Default List of Objects to String array

    Hi Sir,

    I have having a List of objects I need to convert them to String Array. variablesList ArrayList has one char and another String . I need to create String array of all set of objects. Please give your suggestion and help me on this.

    Example :

    List<EquationVariableBO> variablesList = null;
    EquationVariableBO variable1 = new EquationVariableBO();
    variable1.setSign("+");
    variable1.setVariable("02270");



    EquationVariableBO variable2 = new EquationVariableBO();
    variable2.setSign("-");
    variable2.setVariable("01070");
    // variable2.setValue(200);

    EquationVariableBO variable3 = new EquationVariableBO();
    variable3.setSign("-");
    variable3.setVariable("02250");


    EquationVariableBO variable4 = new EquationVariableBO();
    variable4.setSign("-");
    variable4.setVariable("02250");


    EquationVariableBO variable5 = new EquationVariableBO();
    variable5.setSign("-");
    variable5.setVariable("02250");



    variablesList = new ArrayList<EquationVariableBO>();
    variablesList.add(variable1);
    variablesList.add(variable2);
    variablesList.add(variable3);
    variablesList.add(variable4);


    Regards,
    Padam.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,235
    Rep Power
    19

    Default Re: List of Objects to String array

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,235
    Rep Power
    19

    Default Re: List of Objects to String array

    Moved from Advanced Java.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,235
    Rep Power
    19

    Default Re: List of Objects to String array

    Quote Originally Posted by padam View Post
    I need to create String array of all set of objects.
    So what's preventing you from doing that?

    db
    quad64bit likes this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Accessing objects stored in an array list or set
    By kev3kev3 in forum New To Java
    Replies: 6
    Last Post: 04-24-2012, 06:10 PM
  2. Storing objects in an array list?
    By Moedig in forum New To Java
    Replies: 3
    Last Post: 10-27-2011, 06:39 PM
  3. Replies: 6
    Last Post: 09-05-2011, 01:25 PM
  4. Accessing objects in array list
    By kev670 in forum New To Java
    Replies: 6
    Last Post: 03-11-2011, 12:49 AM
  5. Replies: 9
    Last Post: 02-10-2010, 03:19 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •