C
C#14mo ago
Livid

✅ public or local

hey if i have a class like this
public class Dog {
public int publicInt;
int isThisPublic?;

method() {}
}
public class Dog {
public int publicInt;
int isThisPublic?;

method() {}
}
4 Replies
Livid
LividOP14mo ago
is the 2nd integer accesable from other classes (in instances of this class)?
Thinker
Thinker14mo ago
If you don't specify an accessibility level then the member will be private.
Livid
LividOP14mo ago
oh okay ty
Thinker
Thinker14mo ago
In general, if you don't specify an accessibility level then the thing will default to the lowest accessibility, which is private for members and internal for types.
Want results from more Discord servers?
Add your server