Professional Documents
Culture Documents
Topic: Access Modifiers Given The Following Code, Which Statement Can Be Placed at The Indicated Position Without Causing Compilation Errors?
Topic: Access Modifiers Given The Following Code, Which Statement Can Be Placed at The Indicated Position Without Causing Compilation Errors?
Topic: Access Modifiers Given The Following Code, Which Statement Can Be Placed at The Indicated Position Without Causing Compilation Errors?
Given the following code, which statement can be placed at the indicated
position without causing compilation errors?
public class ThisUsage {
int planets;
static int suns;
public void gaze() {
int i;
// ... insert statements here ...
}
}
this = new ThisUsage();
this.i = 4;
this.planets = i;
i = this.planets;
Topic: Access Modifiers
Given the following:
class Gamma {
public int display() {
return 3;
}
}
public class Delta extends Gamma {
@Override
protected int display() {
return 4;
}
}