A pointer can point to an object. But it doesn’t have to. They’re like references without the safeguards. Here’s a little idea to familiarize you with the idea:
Suppose you have a room full of lockers. Every locker can hold exactly one item. Now you put a mobile phone in locker 1. After a while, you decide to move the phone to locker 2. But just in case someone is looking for this phone in the first locker, you leave a note in there: ‘hey, the mobile phone is stored in locker 2 now’.
Locker 1 now points to locker 2. In fact, we can move the phone around and put it in any locker we like. As long as we update the note in locker 1, everyone is able to get our phone with just one easy step: use the location stored in locker 1.
You might be asking yourself: why on earth don’t we just put the phone itself in locker 1 all the time? And you’re right. Let us make it more complicated: imagine every locker has a phone, except for locker 1. For reasons beyond comprehension, the company owning these lockers wants to make sure all phones are used equally. So when someone uses the first phone, the next person should use the second phone. When the last phone is used, we’ll have to use the first one again.
This could get really complicated. Imagine you have to notify everyone in the building that you’ve made phonecall and used the phone in locker 3. And everyone would have to remember that. Won’t it be a lot easier to use a simple procedure?
When all phones are completely discharged, we could even replace the note with the locker ID with an empty note. Everyone would instantly know there’s no phone available when the note is empty.