Implement the following method as a new method for the IntNode class. (Use the u
ID: 3644950 • Letter: I
Question
Implement the following method as a new method for the IntNode class. (Use the usual IntNode definition with instance variables called data and link.)public static boolean all42s(IntNode head)
// Precondition: head is the head reference of a linked list.
// The list might be empty or it might be non-empty.
// Postcondition: The return value is TRUE if EVERY node in the
// list contains 42 in the data part. NOTE: If the list is empty,
// then the method returns true.