Skip to content

charlesbill/OOP-Encapsulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

In this example, the Person class encapsulates the name and age fields by making them private.

Public methods (GetName, SetName, GetAge, SetAge) are provided to access and modify these fields while enforcing validation rules.

This encapsulation ensures that the internal state of the Person object is controlled and manipulated only through well-defined methods.

About

Encapsulation Pattern using C# Console App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published