2、下列程序中定义了一个java接口,其中包含()处错误。public interface Utility {private int MAX_SIZE=20;int MIN_SIZE=10;void use(){System.out.println("using it");}private int getSize();void setSize(int i);}
查看答案
3、以定以下Java代码,不可以填入下划线处的语句是()。public interface Shape{}class TwoDemension implements Shape{}class Circle extends TwoDemension {}class Triangle extends TwoDemension {}public class Test{public static void main(String[] args) {________}}
A. Shape shape = new Shap();
B. TwoDemension circle = new Circle();
C. Shape shape = new TwoDemension();
D. TwoDemension triangle = new Triangle();
4、下列Java代码,可以填入下划线处的语句是()。public interface Constants{int MAX=50;int MIN=1;}public class Test{public static void main(String[] args) {______}}
A. Constants con = new Constants();
B. Constants.MAX = 100;
C. int i = Constants.MAX - Constants.MIN;
D. Constants.MIN>0
5、能够用来修饰interface的有()。
A. public
B. pirvate
C. protected
D. static