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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:05:04+00:00 2026-05-27T08:05:04+00:00

The following is the situation: I have three String parameters a1,a2,a3 Each of the

  • 0

The following is the situation:

I have three String parameters
a1,a2,a3

Each of the parameter has a different number inside

a1: 12

a2: 34

a3: 56

So using a for -loop i want to insert these number into a method

items = the amount of parameters so in this case 3

 for (int i=1;i<=items;i++){
    popupCmplx_RPM(a+i);
    sleep(2);
    }

So the problem is if I run the functionality it will create
for the String a1: a+i -> 121 instead of 12

The parameters are already set I can’t change that part of the code
so help is appreciated. I sure there is an easier way without the parameters, but other that adding new code I can’t remove those

The total amount of parameters set at the moment are 16 some of which can be 0
so in this example there are only three and the rest are zero.
with the int items variable the amount of parameters used is given

  • 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-27T08:05:05+00:00Added an answer on May 27, 2026 at 8:05 am

    It looks like you’re looping and trying to use the index of the loop to reference a variable. You cannot do that (without reflection) in Java.

    (If that’s an incorrect interpretation of your question, please update it to clarify.)

    You probably have a couple options:

    1. Just reference the variables without looping:

      popupCmplx_RPM(a1);
      sleep(2);
      popupCmplx_RPM(a2);
      sleep(2);
      popupCmplx_RPM(a3);
      sleep(2);
      
    2. Store the values in a collection instead of individual variables:

      List<Integer> list = new ArrayList<Integer>();
      list.add(12);
      list.add(34);
      list.add(56);
      
      for(Integer value : list) {
          popupCmplx_RPM(value);
          sleep(2);
      }
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following situation: There is one custom view inside of the first
Consider the following situation: We have two Localizable.string files, one in en.lproj and one
I have the following situation: For ech tree node I have a different type
I have the following situation. Assuming there are 3 systems: A,B,C and A is
I have a following situation in my project. There are some tag values which
I have following situation - Have a MongoService class, which reads host, port, database
Following situation: I have a JFrame and call JOptionPane.showInputDialog(test) . The modal dialog will
I have the following situation: I have an application that collects some data from
Imagine the following situation: I have two branches: DEV and MAIN. I'm working on
Consider the following situation: I have two android projects named P1 and P2 which

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.