Problem:

[sourcecode=’java’]
import java.util.*;
public class Test{
public static void main(String[] args){
ArrayList x = new ArrayList();
x.add(new Student(“Naray”));
x.add(new Student(“Gopal”));

}
}
[/sourcecode]

//in student.java
[sourcecode=’java’]
public class Student {

public Student() {
}

}
[/sourcecode]

Error:
[sourcecode=’java’]
Test.java . 16 cannot find symbol
symbol: constructor Student(java.lang.String)
location: class Student
x.add(new Student(“Naray”)); Test.java . 17 cannot find symbol
symbol: constructor Student(java.lang.String)
location: class Student
x.add(new Student(“Gopal”));
[/sourcecode]
Solution:

make a only string accepting parameter in student constructor