Comp1161 Oop
Comp1161 Oop
1.
2.
codeA
codeB
3. Given
package tutorial7;
public class Institution{
private int instCode;
protected String parish;
public Institution(int c, String p){
instCode = c;
parish = p;
}
a.
package tutorial 7;
public class School extends Institution{
int prinID; int regionNum;
public School(int code, String p){
super(code,p);
}
public String toString(){
return (instCode + "\t"+ parish + "\t" + prinID + "\t" +
regionNum);
}
}
Explain what will happen if a program creates a School called uwi and instantiates it then executes the
following line of code (make adjustments if necessary):
uwi.toString();