Linked list traversing

why is temp!= null is kept null the check shouldnt be on temp.next kuki ussi ki value toh null hogi temp.data thori null hoga ?