Monday, October 8, 2007

Linked List Constructor Functionality Testing

public class IntListTest { public static void main (String [] args) { int [] a = new int [] { 3, 6, 19, 71 }; IntList X = new IntList (0, null); X = X.makeList (a); System.out.println ("List created! "); X.printList(X); IntList Y = new IntList (0, null); int [] x = new int [] { 3, 2, 32, 57, 72, 98, 32, 323 , 232}; Y = Y.makeListr(x); System.out.println ("List created! "); Y.printList(Y); System.out.println ("List Count: " + Y.countList(Y)); } } %java IntListTest List created! Head-0 ---- 3 Head-1 ---- 6 Head-2 ---- 19 Head-3 ---- 71 List created! Head-0 ---- 3 Head-1 ---- 2 Head-2 ---- 32 Head-3 ---- 57 Head-4 ---- 72 Head-5 ---- 98 Head-6 ---- 32 Head-7 ---- 323 Head-8 ---- 232 List Count: 9

No comments:

Just some daily notes ...

Powered By Blogger