Please enable JavaScript to use CodeHS

AP Computer Science A (Nitro)

Lesson 5.8 Scope and Access

Description

In this lesson, students will learn about scope and access. The placement of a variable within a program affects the scope of the variable, meaning where it can be used and accessed in a program. Students will learn how to avoid scope and access errors by using method decomposition. This lesson corresponds with AP Computer Science A topic 5.8.


Objective

Students will be able to:

  • Explain where variables can be used in the program code