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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:45:35+00:00 2026-06-04T13:45:35+00:00

In a java program, I want 3 arraylist variables to be modified by a

  • 0

In a java program, I want 3 arraylist variables to be modified by a call to a single function.

Am I correct in thinking that if I pass these 3 arraylists as parameters to that function, then all 3 can be modified within the function? Or will I have to modify each arraylist in a separate function, and specify that array list as the return value, to ensure that it is modified.

  • 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-04T13:45:37+00:00Added an answer on June 4, 2026 at 1:45 pm

    Am I correct in thinking that if I pass these 3 arraylists as parameters to that function, then all 3 can be modified within the function?

    In a word, yes.

    It is worth noting that the “by reference” terminology in the title of your question is not exactly right. In Java, everything is passed by value, including object references. It is the fact that the three ArrayList parameters are references themselves that makes any changes made to the lists propagate back to the caller.

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

Sidebar

Related Questions

I have a java program which uses arraylists - these arraylists store 'variables' where
I want to write a java program that acts as a user interface to
I want to create java program that can pause / play the vlc video
I am making a Java program and want to open a text(notepad) file ,that
At startup, I want my Java program to load a DLL that should be
I want to create registry key through java program to add the jar file
I want to start my successfully installed Java program after the installation finished. I
I want to create a simple bash script to launch a Java program on
I want run a script as follows: runner: ssh 'java program &' ssh 'java
I want to execute a batch file from a java program. I am using

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.