Hey all..am quite new to Java and I have encountered a problem with my program. I am getting the error message "cannot find symbol constructor". I have tried to figure it out but I have failed. I have read around that adding an empty constructor would help but this is not working either so I am just confused. any help is needed.thanks. Below is the entire code.
class Student {
private String name, add,dit;
public String getname()
{
return name;
}
public String getadd()
{
return add;
}
public String getdit()
{
return dit;
}
public void setname(String n)
{
this.name=n;
}
public void setadd(String a)
{
this.add=a;
}
public void setdit(String d)
{
this.dit=d;
}
public String getdetails()
{
return "i am a student "+"my name is "+this.name +"i am from "+this.add+"my dit no is "+this.dit;
}
}
class ex4{
public static void main(String[] args)
{
Student s1 = new Student("kamal", "kandy", "5678");
System.out.println(s1.getdetails());
}
}
ERROR
ex4.java:49: cannot find symbol
symbol : constructor Student(java.lang.String,java.lang.String,java.lang.String
)
location: class Student
Student s1 = new Student("kamal", "kandy", "5678");
^
1 error
thanks in advance...