Created
June 11, 2021 05:33
-
-
Save gonaumov/23ffa25bdd0002b853f9161ffc44d7f3 to your computer and use it in GitHub Desktop.
What is my age?
This file contains hidden or 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
// You have the class Tree: | |
class Tree { | |
String sort; | |
int age; | |
double height; | |
} | |
/** | |
After you execute the following code, | |
what will be the value of tree1.age ? | |
**/ | |
Tree tree1 = new Tree(); | |
Tree tree2 = tree1; | |
Tree tree3 = tree2; | |
tree1 = new Tree(); | |
tree1.age = 5; | |
tree2.age = 10; | |
tree3 = null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment