What is the difference between a field and a property?

Junior C#

Answer

Field: Stores data directly inside a class.

Property: Provides controlled access to data using getters and setters.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice