Write static method which performs the following operation:
length takes a list and returns the number of integers in it. For example, with [7,3,8,12,9,14]
it would return 6.
import java.util.Scanner; class Lab4Q2 { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Enter a list (of integers): "); String str = in.nextLine(); LispList<Integer> b = parseIntLispList(str); System.out.print("The list you entered is: "); System.out.println(b); int l = length(b); System.out.println("The number of integers is: "+l); } public static int length(LispList<Integer> a){ int l = a.size(); return l; } }