CodeHS 4.9 Local Variables and Scope

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Aaron Pavao
Used 21+ times
FREE Resource
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the term for a variable declared inside a method?
method variable
local variable
global variable
private variable
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What characters denote a block?
< >
[ ]
{ }
( )
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens when a variable is given the same name as a variable with a different scope?
shadowing
RepeatedNamingException
syntax error
infinite loop
Similar Resources on Wayground
10 questions
GDScript Quiz - Lesson 2 - Variables & Functions

Quiz
•
12th Grade
10 questions
Q3 TLE M4

Quiz
•
10th Grade
9 questions
Object Oriented Programming

Quiz
•
11th Grade
10 questions
Year 8 - Unit 2: Small Basic Programming Terminology

Quiz
•
9th Grade
10 questions
QUARTER3 MOD 1 TO 5

Quiz
•
10th Grade
10 questions
TLE Q3 M1-5

Quiz
•
10th Grade
12 questions
Topic 1 C++ Programming

Quiz
•
12th Grade
8 questions
Basics of C Quiz

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade