Respuesta :
Use the knowledge of computational language in JAVA to write a code which is a portion of SomeClass.
How to write code that uses a file?
To make it simpler the code is described as:
SomeClass
private int number;
public void subtractNumbers(int number)
{
number = number − number;
System.out.println("The local variable is: " + number);
System.out.println("The instance variable is: " + number);
}
See more about Java at brainly.com/question/2266606

Answer:
Correct code (For everyone confused):
private int number;
public void multiplyNumbers(int number) {
this.number = this.number * number;
System.out.println("The local variable is: " + number);
System.out.println("The instance variable is: " + this.number);
}
Explanation:
the this. command allows the instance variable of the class to be called instead of the variable in the constructor which as shown can stay the same while still changing the instance variable of the same name. Allowing for the code to be, say if int number was 5. Then the instance variable would be, 5 + 5, which would print:
The local variable is: 5
The instance variable is: 10
Otras preguntas
