Skip to content

Instantly share code, notes, and snippets.

@Aroueterra
Last active May 20, 2021 04:51
Show Gist options
  • Save Aroueterra/10b8d35500b2fd357e2c361280b19ffb to your computer and use it in GitHub Desktop.
Save Aroueterra/10b8d35500b2fd357e2c361280b19ffb to your computer and use it in GitHub Desktop.
class TestClass {
private String color;
public TestClass(String c) {
color = c;
}
public String returnColor() {
return color;
}
public void changeColor(String newColor) {
color = newColor;
}
}
public class expert {
public static void main(String[] args) {
TestClass myObject = new TestClass("red");
myObject.changeColor("blue");
System.out.println(myObject.returnColor());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment