No student devices needed. Know more
7 questions
What is the term for a variable declared inside a method?
method variable
local variable
global variable
private variable
Where does a variable that is declared inside a method exist?
only in that method
only in the class the method is in
only in methods that declare the variable
as long as the program is running
What is scope?
the part of a program where the variable exists
a minty mouthwash
a device used to aim a projectile
a device in a submarine that is used to view the surface
What characters denote a block?
< >
[ ]
{ }
( )
Where does a variable exist?
from when it's declared to the end of the block it's in
from when it's declared to the end of the method it's in
from when it's declared to the end of the class it's in
from when it's declared to the end of the program it's in
When two variables have the same name, which one does Java use?
the one with the most specific scope
the one with the most general scope
the one with the most private scope
the one with the lowest memory address
What happens when a variable is given the same name as a variable with a different scope?
shadowing
RepeatedNamingException
syntax error
infinite loop
Explore all questions with a free account