It just seems to me that all temp is is an IntNode representing the final element in the list
I suspect you realise that this is your mistake but it is a difficult concept to grasp.
In fact temp points at (or more accuately refers to) the final element in the list.
At the point when the code says temp.next = newNode
you are therefore actually making the next
reference of the last entry in the list point to the new entry - which is exactly what you want.