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: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:30
The can be used to paste text in any order
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
When early motion pictures played in movie theaters, they were often accompanied by live organ or piano music. which of the following are the most likely reasons that this happened? (select all that apply). the music was provided to distract audience members from the loud sounds made when filmstrips were changed. the music accompanied the movies because the movies were silent and audiences were used to hearing music during plays in theaters. the music usually was played before, and sometimes after the movie, as an alternative form of entertainment. the music viewers to interpret the dramatic action in the films.
Answers: 2
question
Computers and Technology, 23.06.2019 10:00
Whats three fourths of 15(this is supposed to be in math but i clicked too fast)
Answers: 1
question
Computers and Technology, 24.06.2019 01:30
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
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
Social Studies, 20.05.2021 08:10
question
Mathematics, 20.05.2021 08:10
question
Mathematics, 20.05.2021 08:10
question
Mathematics, 20.05.2021 08:10
Questions on the website: 13722360