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), 25.06.2019 16:00
Which soil horizon, also known as the zone of accumulation, is enriched in clay, iron oxides, silica, carbonate, and other materials?
Answers: 1
question
Advanced Placement (AP), 25.06.2019 23:00
Which of the following best explains why the game of economics does not have a single goal
Answers: 1
question
Advanced Placement (AP), 26.06.2019 06:20
In "daniel in the lion's den" what law do the princes trick the king into signing?
Answers: 1
question
Advanced Placement (AP), 26.06.2019 16:00
What is an effective way to have children experience classic art? a. schedule a field trip to a museum. b. have children find art on their own. c. make sure that the children know all of the art vocabulary. d. ask children to copy a classic piece.
Answers: 2
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
Chemistry, 26.01.2021 01:00
question
Mathematics, 26.01.2021 01:00
Questions on the website: 13722360