Main - Double.parseDouble(sInfo[4 studentList.add(s for(int...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import*; import java.util.*; i public class Main { p public static void main(String[] args) { ArrayList<Student> studentList = new ArrayList<Student>(); Scanner in = null; try { File file = new File("studentData.txt"); in = new Scanner(file); int j = 0; while(in.hasNextLine()) { String line = in.nextLine(); String[] sInfo = line.split(","); Student s = new Student(sInfo[0], sInfo[1], sInfo[2], sInfo[3],
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Double.parseDouble(sInfo[4])); studentList.add(s); } for (int i = 0; i < studentList.size(); i++ ) System.out.println(studentList.get(i)); S System.out.println("\n"); S studentList.remove(2); for (int i = 0; i < studentList.size(); i++) System.out.println(studentList.get(i)); S } catch (Exception e) { System.out.println(e); } finally { if(in != null) in.close(); } } }...
View Full Document

This note was uploaded on 03/25/2010 for the course CIS CIS3023 taught by Professor Seema during the Spring '10 term at Florida College.

Ask a homework question - tutors are online