• + 3 comments

    Even shorter:

    static void reversePrint(SinglyLinkedListNode head) {
            if(head.next!=null) reversePrint(head.next);
            System.out.println(head.data);
    
        }
    
    • + 0 comments

      This will throw a NullPointerException when given head is null. So you might want to handle that.