Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //create an object by passing in a name and age:
- PersonClass variable1 = new PersonClass("Mary", 32);
- PersonClass variable2;
- //Both variable2 and variable1 now reference the same object
- variable2 = variable1;
- PersonClass variable3 = new PersonClass("Andre", 45);
- // variable1 now points to variable3
- variable1 = variable3;
- //WHAT IS OUTPUT BY THIS?
- System.out.println(variable2);
- System.out.println(variable1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement