class Student {
private String name;
public Student(String name){
this.name = name;
}
public String getName(){
return name;
}
}
class StudentServer {
public StudentServer(){
Student[] s = new Student[30];
s[0] = new Student("Nick");
System.out.println(s[0]); // LINE 01:But this compiles, although prints junk
System.out.println(s[0].getName()); // LINE 02:I get a error called cannot find symbol
}
public static void main(){
new StudentServer();
}
}
The above example appeared in this question. Somebody made edits and deleted some formatting from the start of the question, now class Student {
appears as regular text, not Code
.
What's weird is that it appears right in the preview window.
inconsistency
orsoftware problem
.