subject

Consider the following code, which is supposed to add a value passed to the method to an instance variable; however, there is a problem. Re-write this code, without renaming any variable names, to resolve this problem. Code:

private int number = 1015;

public void multiplyNumbers(int number)

{

number = number * number;

System. out. println("The local variable is: " + number);

System. out. println("The instance variable is: " + number);

}

Please help :(((

ansver
Answers: 1

Another question on Advanced Placement (AP)

question
Advanced Placement (AP), 24.06.2019 03:30
Which of the following is a type of technology that can be used at a coal-burning power plant to remove both particulate matter and gases? bag filter catalytic converter cyclone electrostatic precipitator scrubber
Answers: 3
question
Advanced Placement (AP), 24.06.2019 21:30
Hey guys! this is not for school. i my dog gave birth a week ago and we are celebrating them today so i decided to give out a ton of points, a tnx and brainiest to whoever answers the following questions. 1. did you have a good day today. 2. do you like dogs (its okay if you don’t) 3. if you were an animal, what animal would you be? (i am just curious. i would be a unicorn.)
Answers: 2
question
Advanced Placement (AP), 25.06.2019 03:00
Secondary school falls between a . kindergarten & elementary b. elementary school & post secondary school c. post secondary school & higher education d. middle school & high school
Answers: 1
question
Advanced Placement (AP), 25.06.2019 13:00
Which allows college students to work part time jobs to pay for educational expenses
Answers: 1
You know the right answer?
Consider the following code, which is supposed to add a value passed to the method to an instance va...
Questions
question
Mathematics, 11.01.2021 21:20
question
Mathematics, 11.01.2021 21:20
question
Mathematics, 11.01.2021 21:20
question
English, 11.01.2021 21:20