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

Will vote brainliest!! Can someone please help me with the empirical formula of C:46.66% H:4.48% N:31.10% O:17.76% I am getting 3C 4H 2N 1O but this is not o
Japanese occupation weakened european and american colonial establishments. What was going on at this time, before the outbreak of WWII?
Can someone please help with these other short 4 questions thank you
Maura measures the length,conductivity, mass, and density of acopper wire. Which of the following areextensive properties of the copperwire?​
the sum of two numbers is 68.the smaller number is 8 less than the larger number what are the numbers​
What are 'taboos'? How do they affect fertility​
A farmer has 300 ft of fencing to enclose a rectangular pen next to a barn and the barn itself will be used as one of the sides of the enclosed area. What is th
3 digit largest number
Which was given as a justification for US invasion of Iraq in 2003?
I meed help please.