Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
pompa
pompa's Profile
1
Posts
0
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Basic Java question: Accessing private class variables
[1 Reply]
09-Aug-2013 04:45 PM
Forum:
Programming Questions
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();
}
Here, member is private, so why am I able to access it from outside of the class directly?
«Prev
Next »
Moderate user : pompa
Forum