When I started learning object-oriented programming in Java, I hit a wall that I think a lot of beginners hit: I thought I understood how variables worked, until objects entered the picture. Here's the mistake I made and what actually clarified it for me.
The mistake
In Java, primitive types (int, double, boolean, char, etc.) work exactly how you'd expect — when you assign one variable to another, you get a copy.
int a = 5;
int b = a;






