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 7874395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:47:54+00:00 2026-06-03T02:47:54+00:00

Namely, without referencing the same object, I need to copy values of elements of

  • 0

Namely, without referencing the same object, I need to copy values of elements of one list into another list. These are the lists:

List<Integer> listA = new ArrayList<Integer>();
List<Integer> ListB = new ArrayList<Integer>();

listA = (added some values);

listB = (do what?)...

PS. I appologize for beginner’s question, but I have never done such a thing.

  • 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-06-03T02:47:55+00:00Added an answer on June 3, 2026 at 2:47 am

    You can try and give a look at the Collections.copy method:

    public static void copy(List dest,
    List src)

    Copies all of the elements from one list into another. After the operation, the index of each copied
    element in the destination list will be identical to its index in the
    source list. The destination list must be at least as long as the
    source list. If it is longer, the remaining elements in the
    destination list are unaffected. This method runs in linear time.

    Parameters: dest – The destination list. src – The source list.

    Note: The above should work for simple data types such as Integers, however, if you have your own objects which might in turn reference other objects, you will have to iterate over each object and copy it separately.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 3 tables namely: Town; Village; Farmers...and I need to COUNT how many
Namely, how does the following code: var sup = new Array(5); sup[0] = 'z3ero';
Namely, a DLL name has an extra @8 at the end which is causing
I have two classes namely classA and classB which both inherit from class1 .
I have 2 files namely: uploading.php emaillinks.php both include a file inc.php which has
I have two dates namely the filecreation date and the system date both in
i am having three tables namely 1)cd_register |----------------------------------------------------| | username | name | age
I'm getting a class cast exception namely java.lang.ClassCastException: android.app.Application cannot be cast to greendroid.app.GDApplication
I have two files, namely game.py and map.py. The following simplified code resides in
Is there any reporting tool which offers multilingual support (namely English en-US and Arabic

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.