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