nachy4863 nachy4863
  • 07-06-2018
  • Computers and Technology
contestada

In a java class, variables can be present both inside and outside of methods. question 9 options:
a. True
b. False

Respuesta :

IsrarAwan
IsrarAwan IsrarAwan
  • 17-06-2018
The correct answer is: True

Explanation:

Consider the following program:
class Main {
int a = 10;
public static void main(String[] args) {
add();
}

private static void add() {
int b = a+20;
System.out.println(b);
}
}


The output of the above program is 30. As you can see the variable a is declared outside the method, whereas variable b is declared inside the method.
Answer Link

Otras preguntas

Personal, payroll, medical, and operational are all what types of information
How to use slope to determine parallel and perpendicular lines?
245÷62 and 23÷8303 and 14÷532 and 11×8-6÷2
An alien—either legal or illegal—does NOT have which of the following rights?
Define business cycle
Which of the following citizens are required to sign up for selective services?
What two numbers sum up to 17 and the they can subtract to get 5.?
Can someone please awnser this
Which of the following describes a chemical change? a. ethanol boils when heated. b. ethanol has a high heat capacity. c. ethanol can be produced by the ferm
solve this equation -x+4=x+6 Is it "No Solution"?