3. [10] Write a short JAVA method to count the number of nodes in a singly-linked list using the following declaration. Assume that each node contains an integer key and a link to the next node. public class Node private int element; private Node next; public void getNext() { return next; } } public class List { private Node head; public int countNodes().