Computers and Technology

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

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:30, marialuizavalen
Today is the anniversary of me being on yet, i don't need it anymore! here's a picture of my dog wearing a bowtie! my question is, how do i delete my account?
Answers: 1
image
Computers and Technology, 22.06.2019 23:30, Molly666
What does 21 pilots middle aged name as a band 15 years prior to them naming their band 21 pilots?
Answers: 1
image
Computers and Technology, 23.06.2019 11:30, talyku7131
Me dangers of social media and the internetexplain what each means: 1) social media and phones have become an addiction.2) outside people have access to you all the time.3) cyberstalking4) cyberbullying5) catphishing6) viruses7) identity theft8) credit card fraud9) hacking10) money schemes
Answers: 1
image
Computers and Technology, 23.06.2019 14:30, ladawnrowles005
The option enables you to modify a slide element in most presentation applications.
Answers: 2
Do you know the correct answer?
Consider the following code, which is supposed to add a value passed to the method to an instance va...

Questions in other subjects:

Konu
Mathematics, 28.01.2021 23:00
Konu
Mathematics, 28.01.2021 23:00