Driver program
public static void main ( String args [ ] ) { Node head = newNode ( " Geeksforgeeks " ) ; head . next = newNode ( " a " ) ; head . next . next = newNode ( " computer " ) ; head . next . next . next = newNode ( " science " ) ; head . next . next . next . next = newNode ( " portal " ) ; head . next . next . next . next . next = newNode ( " for " ) ; head . next . next . next . next . next . next = newNode ( " geeks " ) ; System . out . print ( "List before reverse: NEW_LINE"); printList ( head ) ; head = reverse ( head ) ; System . out . print ( " List after reverse : "); printList ( head ) ; } }