Can't find constructor

Please some help:import java.util.*;

import java.lang.*;

publicclass Student

{

private String firstName;

private String lastName;

privatedouble[] testScores;

privatechar grade;

public Student()

{

firstName ="";

lastName ="";

}

public Student(String fName, String lName,double testScores,double list)

{

firstName = fName;

lastName = lName;

}

public String toString()

{

String str;

str = String.format("%-10s %-10s", firstName, lastName);

return str;

}

}

import java.util.*;

import java.lang.*;

publicclass TestStudent

{

publicstaticvoid main(String[] args)

{

Student student1 =new Student("John","Davies");

Student student2 =new Student("Peter","Johns");

System.out.println(student1);

System.out.println(student2);

}

}

I have error :

can't find symbol - constructor Student java.lang.String.java.langString

Thx

[2384 byte] By [AsYourMindFliesa] at [2007-11-27 5:31:19]
# 1
I see two constructors that you created for the Student class that you created. Neither one of them takes exactly (String, String) for arguments.Which one would you expect to be called by that line?
jverda at 2007-7-12 14:56:24 > top of Java-index,Java Essentials,New To Java...
# 2
double testScores, double listwiped out and works Thx AYMFNow I want user to enter the first and last name.Do I have to imply get and set method in student class?ThxMessage was edited by: AsYourMindFlies
AsYourMindFliesa at 2007-7-12 14:56:24 > top of Java-index,Java Essentials,New To Java...
# 3
>Do I have to imply get and set method in student class?I thought their implementation was already implied ;-)
Hippolytea at 2007-7-12 14:56:24 > top of Java-index,Java Essentials,New To Java...
# 4
> Now I want user to enter the first and last name.> Do I have to imply get and set method in student> class?> ThxWhat do you mean "imply"?If you want to set values for an object after construction, the usual way is with a setter
jverda at 2007-7-12 14:56:24 > top of Java-index,Java Essentials,New To Java...
# 5
I want in class studentest that user enters student first and last namesThx
AsYourMindFliesa at 2007-7-12 14:56:24 > top of Java-index,Java Essentials,New To Java...
# 6

> I want in class studentest that user enters student

> first and last names

Well, if they first provide the names, and then you create the objects, you can pass the names to the constructor.

If you first create the object, and then want to set/change the names, you'll probably want a setter method.

jverda at 2007-7-12 14:56:24 > top of Java-index,Java Essentials,New To Java...
# 7
> I want in class studentest that user enters student> first and last names> ThxIt's typical that such a class have setters and getters, but put the user-interactionin another class, to keep Student simple.
Hippolytea at 2007-7-12 14:56:24 > top of Java-index,Java Essentials,New To Java...
# 8

import java.util.*;

public class StudentName

{

static Scanner console = new Scanner(System.in);

private String name;

public String getName()

{

return name;

}

//

//Method to set the name according to the parameters

public void setName(String userName)

{

name = userName;

}

}

What I wanted is array name that user can fill with f l name.

Thx

AsYourMindFliesa at 2007-7-12 14:56:24 > top of Java-index,Java Essentials,New To Java...
# 9
Keep your Student simple. Remove the Scanner you stuck in his head.
Hippolytea at 2007-7-12 14:56:24 > top of Java-index,Java Essentials,New To Java...
# 10

> import java.util.*;

>public class StudentName

>

> private String name;

>

>public String getName()

>

> return name;

> //

>

> /Method to set the name according to the parameters

>public void setName(String userName)

>

> name = userName;

>}

What I want is array "name" that user can fill with f l

name.

Thx

AsYourMindFliesa at 2007-7-12 14:56:24 > top of Java-index,Java Essentials,New To Java...
# 11
What sort of response are you hoping for?
Hippolytea at 2007-7-12 14:56:24 > top of Java-index,Java Essentials,New To Java...
# 12
What ever
AsYourMindFliesa at 2007-7-12 14:56:24 > top of Java-index,Java Essentials,New To Java...
# 13
I have no idea what you're even asking.
jverda at 2007-7-12 14:56:24 > top of Java-index,Java Essentials,New To Java...
# 14
"It's like so, whatever"Maybe you'd have better luck asking at the mall.
Hippolytea at 2007-7-12 14:56:24 > top of Java-index,Java Essentials,New To Java...
# 15
> "It's like so, whatever"> > Maybe you'd have better luck asking at the mall.Maybe
AsYourMindFliesa at 2007-7-21 21:30:24 > top of Java-index,Java Essentials,New To Java...