Answer Overflow Logo
Change Theme
Search Answer Overflow
GitHub
Add Your Server
Login
Home
Popular
Topics
Gaming
Programming
LDami
Posts
Comments
C
C#
•
Created by LDami on 4/25/2024 in
#help
✅ ObjectDisposedException without explicit trace
77 replies
C
C#
•
Created by LDami on 9/17/2022 in
#help
Is there any benefit to write a Property with a private variable ?
Why:
private int
myVar
;
public
int MyVar {
get
=>
myVar;
set
=>
myVar
=
value; }
private int
myVar
;
public
int MyVar {
get
=>
myVar;
set
=>
myVar
=
value; }
may be better than:
public int
MyVar
;
public int
MyVar
;
if we let get and set public ?
34 replies