Question: b . consider the following constructors for class staff : public geaff ( ) { this name = ; this. i d =

b. consider the following constructors for class staff :
public geaff(){
this name="";
this. id=0;
}
public staff(int i, String n) &
name =n;
id=i;
}
public stafe(int i)s
name =n;
id=i;
3
public staff(3tring n)}
name =n;
id =0;
3
public stafe (stafe s)}
name = s. name;
id=5.id;
}
Rewriting the code to use this in the constructor (1,3,4) :
note:
1- don't put any space when writing the code.
ex:
this () incorrect
this () correct
2-use these symbols for string "'" and these symbols for character "
Rewriting the code to use this in constructor (1,3,4) :
public staff (){// constructor 1
]
public staff(int i, String n) & // constructor 2
name =n;
id=i;
]
public staff(3tring n) f // constructor 3
}
public staff (staff s)f// constructor 4
 b. consider the following constructors for class staff : public geaff(){

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!