Skip to content

Apollo-Level2-Web-Dev/ts-conceptual-sesssion-part-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Summary of Access Modifiers

Modifier Accessible Within Class Accessible in Subclasses Accessible Outside Class
public Yes Yes Yes
private Yes No No
protected Yes Yes No

Key Takeaways

  • Use public for members that need to be accessible by all parts of the application.
  • Use private for members that should only be used internally within the class.
  • Use protected for members that should be accessible in the class and its subclasses but not from outside.

Access modifiers help encapsulate class data and methods, ensuring that your code is more modular, maintainable, and less prone to errors.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published