Sept. 27, 2023, 12:13 p.m. | ByteHide

DEV Community dev.to




Understanging “Fields”


In the object-oriented programming (OOP) approach of C#, a field is a class or struct level variable that holds data specific to an instance (object). It forms the identity of an instance, named as instance fields.


Try and keep your variables private (common practice to have an underscore as prefix) to prevent external access and only expose via properties or methods.


Do you keep your treasure box locked and hidden? That’s what private variables are like. They …

class csharp data dotnet forms identity instance object oop practice private programming variable

CyberSOC Technical Lead

@ Integrity360 | Sandyford, Dublin, Ireland

Cyber Security Strategy Consultant

@ Capco | New York City

Cyber Security Senior Consultant

@ Capco | Chicago, IL

Sr. Product Manager

@ MixMode | Remote, US

Corporate Intern - Information Security (Year Round)

@ Associated Bank | US WI Remote

Senior Offensive Security Engineer

@ CoStar Group | US-DC Washington, DC