Wednesday, July 2, 2014

This is really quite that simple. To write as good code as possible that also could be used subject


This is really quite that simple. To write as good code as possible that also could be used subjects should use encapsulation (encapsulation). This means that other classes or objects not directly access the variables, but must make use of getters and setters ... example: sulfuric acid class Test {int x; int y; public void setX (int x) {this.x sulfuric acid = x; } Public int getX () {return x; }} Now you can through the class interface or API call get and set methods to retrieve or set a value to x / / Frennesson
2011 (8) November (6) New Marshall lurking! Subclass and Superclass Encapsulation - encapsulation Coupling and Cohesion IS-A and HAS-A Java and static methods! October (2)


No comments:

Post a Comment