Skip to content

This is my OOPS Repository and i had kept my all OOPs concept which i learned. If you wanna contribute you may.

Notifications You must be signed in to change notification settings

debapriyo007/OOps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔥 OOPS Concepts 🔥

This repository contains code examples and explanations for various Object-Oriented Programming (OOPS) concepts.

Access Modifiers

Access modifiers in OOPS determine the visibility and accessibility of class members (variables and methods). They help in controlling the access to sensitive data and functionality within a class or across different classes and packages.

The following table summarizes the different access modifiers and their visibility:

Image |

Private Access Modifier

The private access modifier restricts the visibility of a member to only within the same class. It is used to encapsulate sensitive data or implementation details that should not be accessed or modified from outside the class.

Default Access Modifier

The default access modifier (also known as package-private or package-level access) allows access to members within the same package. It is used when you want to share members between classes within the same package but restrict access from classes outside the package.

Protected Access Modifier

The protected access modifier allows access to members within the same class, same package, and subclasses (even if they are in a different package). It is used when you want to provide access to subclasses for inheritance purposes while still restricting access from classes outside the package.

Public Access Modifier

The public access modifier allows unrestricted access to members from anywhere. It is used when you want to make a member accessible to all classes and packages.


Feel free to explore the code examples in this repository to understand how access modifiers can be used in different scenarios.

Happy coding! 💛 🔥

About

This is my OOPS Repository and i had kept my all OOPs concept which i learned. If you wanna contribute you may.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages