No, they're not.
public class Example1 {
public static void main(String[] args) {
Example2 e2 = new Example2();
e2.var = 56; // 1
e2.setVar(56); // 2
}
}
public class Example2 {
public int var;
public void setVar(int v) {
var = v;
}
}
1 and 2 both work.
Is this what you mean or...?
__________________
check out To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , 100% made by me. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|