I have this Java program, but my test gives me this message:
testEmployeeTostring: failed testEmployeeTostring expected <[id[= 1013, name= Jubal Early, job = ]procurement]> but was: <[id[= 1013, name= Jubal Early, job = ] procurement]>
I had to use @Override and I think that's the problem. I hope someone can figure out the problem with this:
public class Employee {
int id;
String name;
JobType job;
public Employee(int id, String name, JobType job)
{
this.id = id;
this.name = name;
this.job = job;
}
@Override public String toString()
{
return ("["+ "id =" + id + ", name = " + name + ", job = " + job + "]");
}
}
There is a space between ] and 'procurement'
job = ] procurement
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With