Saturday 15 May 2010

recursion - Input and output recursive java Scanner -


I'm really sure that the hard times are in understanding the input and output of text files. I'm not sure how I implemented my input text file in two recursive ways that I had created, would I want to create a text file inside the constructor? Any help would be really appreciated.

Import java.util. *; Import java.io * *; / ** * @ Author (Matt Mastel) * @Varijan (3/14/15) * / Public Category CS 152 {Fixed Last B MAXSIZE = 22; Private static integer size = 0; ArrayList & LT; Students & gt; Slist = new arrelisted & lt; Students & gt; (MAXSIZE); Scanner scan = new scanner (new file ("input.txt")); Public static student [] create list (scanner scan) {student [] list = new student [MAXSIZE]; Return land list (list, scan); } Private Stable Students [] Populated List (Student [] List, Scanner Scan) {Student; If (size & lt; MAXSIZE & amp; scan; hasNext ()) {s = new student (scan.NXT), scan. NXT (Scan) NXT (Scan) NXD double (), scan. NXITINT ()); List [size] = s; Size ++; Return land list (list, scan); } And {return list; }} Public static inset () {return size; }}


No comments:

Post a Comment