Public pro... 默认 private 的区别
第1题:
说明Friendly,private,protect,public四者间的区别?
第2题:
说明:如果在修饰的元素上面没有写任何访问修饰符,则表示friendly。
当前类 同一package 子孙类 其他包
public √ √ √ √
protected √ √ √ ×
friendly √ √ × ×
private √ × × ×
第3题:
简述作用域public,protected,private,以及不写时的区别。
第4题:
PKI是()。
第5题:
public/protect/private/internal修饰符的区别
第6题:
Which the two demonstrate an “is a” relationship?()
第7题:
Which three form part of correct array declarations?()
第8题:
PKI的全称是()。
第9题:
对
错
第10题:
第11题:
public interface Person {} Public class Employee extends Person {}
public interface Shape {} public interface Rectangle extends Shape {}
public interface Color {} public class Shape { private Color color; }
public class Species {} public class Animal { private Species species; }
interface Component {} Class Container implements Component {private Component [] children;
第12题:
public class Circle implements Shape { private int radius; }
public abstract class Circle extends Shape { private int radius; }
public class Circle extends Shape { private int radius; public void draw(); }
public abstract class Circle implements Shape { private int radius; public void draw(); }
public class Circle extends Shape { private int radius;public void draw() {/* code here */} }
public abstract class Circle implements Shape { private int radius;public void draw() { / code here */ } }
第13题:
作用域public,private,protected,以及不写时的区别
区别如下:
作用域 当前类 同一package 子孙类 其他package
public √ √ √ √
protected √ √ √ ×
friendly √ √ × ×
private √ × × ×
不写时默认为friendly
第14题:
第15题:
Which three demonstrate an “is a” relationship?()
第16题:
包的访问控制分为public protected private 和默认,默认时为public。
第17题:
public class X { public X aMethod() { return this;} } public class Y extends X { } Which two methods can be added to the definition of class Y?()
第18题:
Which two demonstrate an “is a” relationship?()
第19题:
public abstract class Shape { private int x; private int y; public abstract void draw(); public void setAnchor(int x, int y) { this.x = x; this.y = y; } } Which two classes use the Shape class correctly?()
第20题:
PKI是()。
第21题:
第22题:
harder to make a choice between public and private schools
harder to go to private schools this year than before
more difficult to go to public schools than to private schools
as difficult to go to private schools this year as before
第23题:
public class X { } public class Y extends X { }
public interface Shape { } public interface Rectangle extends Shape{ }
public interface Color { } public class Shape { private Color color; }
public interface Species { } public class Animal { private Species species; }
public class Person { } public class Employee { public Employee(Person person) { }
interface Component { } class Container implements Component { private Component[] children; }