Professional Documents
Culture Documents
Angrej Assign6
Angrej Assign6
1. Source code:
Output:
2. Source code
Output:
1. Scope of Class and Object in Java Programming:
Class Scope: Determines where the class can be accessed, such as within the same
package or from other packages if declared as public.
Object Scope: Refers to the lifetime and accessibility of the object within the program,
including method or block scope.
Benefit: Well-defined scopes enable modular, reusable, and maintainable code, improving
security, efficiency, and code organization.