Need to use a for-each loop and the raise each person gets is 1000.
Would it be like this?
int raise = 1000;
for (Person i : people){
people.add(raise, i);
}
im working with this
public ArrayList<Person> people;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
If what you want is to raise for example salary by 1000 for every person, it would be more like:
1.Define a class.
2.Use
raiseSalary(int salary)method on everyPersonin your for-each loop.Dont forget to import
java.util.*in order to useListandArrayList.Read about for-each loop here.