public class Employee { String name; boolean contract; double salary; Employee() { // line n1 } public String toString() { return name + ":" + contract + ":" + salary; } public static void main(String[] args) { Employee e = new Employee(); // line n2 System.out.print(e); } }
joe: true: 100.0?
e.name = "Joe"; e.contract = true; e.salary = 100;
this.name = "Joe"; this.contract = true; this.salary = 100;
this.name = new String ( "Joe") ; this.contract = new Boolean (true) ; this.salary = new Double(100) ;
name = "Joe"; contract = TRUE; salary = 100.0f;
this ("Joe", true, 100);