Last active
May 20, 2021 04:51
-
-
Save Aroueterra/10b8d35500b2fd357e2c361280b19ffb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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