The Scope of a variable defines the areas of a program where this variable would be visible and can be used. For ex:
a. Method variables - are visible only inside the method where they are declared and hence their scope is only the method
b. Class variables - are visible inside the class and can be used by any method inside the class and hence their scope is the whole class.
Copyright © 2026 eLLeNow.com All Rights Reserved.