error help

try compile the code kindly tell me on how to fix the error ..i think i have done corrent in building the constructor..the error says, "CANNOT FIND SYMBOL - CONSTRUCTOR EXERCISE311(java.lang.String)" how the hell that happened since the first class is correct ..

publicclass Exercise311

{

private String courseName; String teacherName;

public Exercise311(String name, String teacher)

{

courseName = name;//initialize courseName;

teacherName = teacher;

}

publicvoid setCourseName(String name)

{

courseName = name;//stores courseName

}

publicvoid setTecherName(String teacher)

{

teacherName = teacher;//stores courseTeacher

}

public String getCourseName()

{

return courseName;

}

public String getTeacherName()

{

return teacherName;

}

publicvoid displayMessage()

{

System.out.printf("Welcome to Programming for %s\n",getCourseName());

}

}

HERE'S THE MAIN CLASS

publicclass _311

{

publicstaticvoid main(String[] args)

{

Exercise311 new_311 =new Exercise311("Computer Engineering");

new_311.displayMessage();

}

}

[2524 byte] By [nemo666a] at [2007-11-27 11:29:28]
# 1

It seems to me that you are trying to pass in 1 argument from your main class

when your constructor is set up to take 2 arguments

public Exercise311(String name, String teacher)

{

courseName = name;//initialize courseName;

teacherName = teacher;

}

make sure you have another constructor to take one argument or alter the following:

Exercise311 new_311 = new Exercise311("Computer Engineering");

to look like this

Exercise311 new_311 = new Exercise311("Computer Engineering", "Teacher");

Blue_Chimeraa at 2007-7-29 16:28:09 > top of Java-index,Java Essentials,New To Java...
# 2

here ill narrow it down for you:

(a) public Exercise311(String name, String teacher)

(b) Exercise311 new_311 = new Exercise311("Computer Engineering");

TuringPesta at 2007-7-29 16:28:09 > top of Java-index,Java Essentials,New To Java...
# 3

Sorry.

kraton_mayaa at 2007-7-29 16:28:09 > top of Java-index,Java Essentials,New To Java...