Scope refers to where a variable is accessible in a program. Think of scope as a container or "bubble" around a variable that determines where you can use that variable in your code. A variable's scope is defined by the location where it is declared. There are two primary types of scope in Java: local scope and global scope.
When a variable is declared inside a method, constructor, or block (e.g., a loop or conditional), it is said to have local scope. This means the variable only exists while that block of code is being executed, and it cannot be accessed from outside that block.