The Concept of Scope
The term scope applies to the visibility of the programming elements within a program. This term is usually applied to the variables within the program. For Java, variables represent either primitive data types or object references. Java provides eight primitive data types: byte, char, short, int, long, float, double, and boolean. Everything else in the Java language is an object reference. Since object references can represent any valid Java class, there is a great deal of flexibility and extensibility in this process. Since for all effective purposes, a Java class is a data type, the Java language is type extensible—whatever data type is needed can be created as a class.
All Java references have some form of scope. For ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access