C
C#2y 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
LividOP2y ago
is the 2nd integer accesable from other classes (in instances of this class)?
Thinker
Thinker2y ago
If you don't specify an accessibility level then the member will be private.
Livid
LividOP2y ago
oh okay ty
Thinker
Thinker2y 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.

Did you find this page helpful?