I have a class :
class Employee{...}
then :
Employee aEmployee = new Employee(...);
int i = 10;
String str = aEmployee + i;
it generates a ERROR when compiled, Why ?
// EDIT ////////////////////////////////////
:
I didn't override the toString() method in Employeethe Employee class
but, but if I try this :
Employee aEmployee = new Employee(...);
String h = "hello";
String str = aEmployee + h;
this time will be fine , both compiling and running
So .
So: why is it OK after changechanging the intint variable ii to a StringString variable h h?