Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6802553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:14:14+00:00 2026-05-26T19:14:14+00:00

I am extracting an array of data and setting those data inside an Object

  • 0

I am extracting an array of data and setting those data inside an Object in Java .

I don’t know, after getting the data from an array, how can I set this into an Object ??

please have a look at the code below:

public class Legform implements Serializable {

    private SecurityType securityType;

    public SecurityType getSecurityType() {
        return securityType;
    }

    // As well as a setter Method also present
}

I am extracting this LegForm Object (the above one) here as shown from another java class :

Legform[] legdata = orderform.getLeg();

After looping throught this data, I need to set them inside another object called Leg (a Java class)

for(int i = 0; i < legdata.length; i++) {
    System.out.println(legdata[i].getSecurityType());
    // Here do i need to set the data into  the Leg Object 
}

I need to set this extracted information to a Leg Object
The Leg Object is shown below :

public class Leg
{
  public String securityType;

}

could anybody help me please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:14:15+00:00Added an answer on May 26, 2026 at 7:14 pm
    List<Leg> legs = new ArrayList<Leg>(legdata.length);
    for (Legform ld: legdata){
       Leg leg = new Leg();
       leg.securityType = ld.getSecurityType();
       legs.add(leg);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm extracting some string data from a plist: <dict> <key>Feb 7, 2000</key> <array> <string>7</string>
I am having some problems extracting the data I want from a SimpleXMLElement object.
I'm using Cluebat-man's LabVIEW-C++ array interoperability class, and I'm getting an error extracting the
Extracting data from XML I want to preprocess one before sending it as a
I'm having difficulty extracting amplitude data from linear PCM on the iPhone stored in
I'm analyzing music mp3 files. What I'm doing is extracting the audio data from
When extracting data from a list this way line[0:3], line[3][:2], line[3][2:] I receive an
I am extracting string from an byte array. The string is a sql script.
I am extracting data from a database and storing it in two arrays, one
sorry for the vague title. I'm extracting some data from a table with the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.