Basic Java question: Accessing private class variables
in
Programming Questions
•
2 months ago
I guess I'm confused about private variables in Java. To generalize this as much as possible for Processing, here's some simple code:
- class Thing {
- private int member;
- }
- void setup() {
- size(1, 1, P2D);
- Thing thing = new Thing();
- thing.member = 1; // why can I do this?
- exit();
- }
1