Quiz: Copying Numbers
What is now in luckyNumber? |
13 |
Of course, luckyNumber has not changed. |
What is the value of luckyNumber2? |
12 |
luckyNumber2 was first 13, and then it was changed to 12. Note that number variables store numbers. That's different from objec variables—they store references to objects which can be shared. |