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

  • Home
  • SEARCH
  • 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 6853471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:30:57+00:00 2026-05-27T01:30:57+00:00

This is complicated, but I will do my best to explain my question. Object

  • 0

This is complicated, but I will do my best to explain my question. Object customer from the Customer class has a arraylist inside the object that store different account numbers. And all of the customer objects are stored in a arraylist. So my problem and question is how to get the account numbers from the arraylist, customerAccountsList, inside the object customer that is inside the arraylist customerList!?

With some help from previous questions here I have learned how to get values from objects inside an arraylist like this:

customerList.get(index).getAccountOwnername();

But now I’m looking for something like this:

customerList.get(index).getAccountNumbers(????);

Help is preciated! Thanks!

EDIT:

customerList.get(index).getAccountNumbers(arraylist that holds all account numbers)

I want to either get a single account number or all account numbers that are inside the arraylist. I don’t want to do it to complicated since I rather new in java programming

EDIT 2:

Inside the Customer class I have this code:

ArrayList<String> customerAccountsList = new ArrayList<String>();

Inside the main class I have this code:

// create an arraylist to store customer objects
ArrayList<Customer> customerList = new ArrayList<Customer>();
  • 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-27T01:30:58+00:00Added an answer on May 27, 2026 at 1:30 am

    i guess what you are trying to do is

    customerList.get(indexCustomer).getAccountNumbers().get(indexAccount)

    Depending on your needs, you might have to some re-factoring that is :

    1. Create an object AccountNumbersList having an arrayList
    2. Add the appropriate methods to the previous object getFirstAccount, getLastAccount, getSavingAccount etc.
    3. Change the reference of Customer : refer to AccountNumbersList object
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, this scenario is a little complicated, but I will try to explain it
This is hard to explain, but I will do my best: I am building
Its a little bit complicated, but I will try to explain as best as
If I have a form-backing object that has a complicated object tree -- say
So this is a bit complicated situation, so I will try to explain what
This isn't a complicated question. I was just thinking through best practice and thought
Ok so this is a really complicated problem, I will try my best to
I know this isn't so complicated but I can't remember how to do. I
This is a complicated situation (for me) that I'm hopeful someone on here can
Before you answer, this question is complicated: We are developing in asp.net / asp.net

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.