SCJP 1.4, SCJD 1.4, SCWCD 1.3, ICSD:Websphere 5.1
Originally posted by N. Gonzalez:
public class StudentTest {
public static void main (String[] args) {
String [] studentarray = new String [studentarray.length];
Student studentarray [0] = new Student {"Mary","Smith","111 Smith Street","New York","NY",10001,"msmith@nyu.edu","212-555-1111",true};
Student studentarray [1] = new Student {"Bill","Brown","222 Brown street","New York","NY",10002,"bbrown@nyu.edu","212-555-2222",true};
Studentstudentarray [2] = new Student {"Jill","Jones","333 Jones Street","New York","NY",10003,"jjones@nyu.edu","212-555-3333",true};
Student studentarray [3] = new Student {"John","Martin","444 Martin Street","New York","NY",10004,"jmartin@nyu.edu","212-555-4444",true};
Student studentarray [4] = new Student {"Bob","Wilson","555 Wilson Street","New York","NY",10005,"bwilson@nyu.edu","212-555-5555",true};
Student studentarray [5] = new Student {"Betty","Boop","666 Boop Street","New York","NY",10006,"bboop@nyu.edu","212-555-6666",false};
for (int i=0; i<studentarray.length; i++){
System.out.println(studentarray[i].toString() + "\n");}
}
}
String [] studentarray = new String [...];
String [] studentarray = new String [studentarray.length];
SCJP 1.4, SCJD 1.4, SCWCD 1.3, ICSD:Websphere 5.1
StudentTest.java:37: '{' ir '[' expected
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |