class student { protected String name; protected double gpa; protected int year; // boring info skipped.. protected static int tuition; // same for all students public student(String n) // constructor { name = n; year = (int)(Math.random()*5); gpa = ((int)(Math.random()*401))/100.0; } // no destructors needed // can have alternate constructors // accessor: public String name() { return name; } // can overload "name" public void setyear(int y) { if (y>=0 && y<4) year = y; else throw new RuntimeException("invalid year value"); } // instead of print, override tostring function of superclass Object, // keyword "virtual" not needed public String toString() { String[] Y = {"freshman","sophomore","junior","senior","grad student"}; return name+" is a " + Y[this.year] +" with a GPA of "+gpa; } }//student class public class first17 // main must be in public class { static void f(student s) // is s a pointer? { s.setyear(3); } public static void main(String[] argv) // what does static mean? { student s2 = new student("Ed"); s2.setyear(1); System.out.println(s2.toString()); f(s2); System.out.println(s2); // automatically calls .toString on s2 String[] Roster = {"Allen","Alex","Fred"}; student[] Students = new student[ Roster.length ]; for(int i=0;i