题目内容

以下哪个接口的定义是正确的?()

A. interface B
B. abstract interface B
C. abstract interface B extends A1,A2 //A1、A2为已定义的接口

查看答案
更多问题

下面的程序中定义了一个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);}

A. 1
B. 2
C. 3
D. 4

给定如下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 Shape();
B. TwoDemension circle =new Circle ();
C. Shape shape =new TwoDemension();
D. TwoDemension triangle =new Triangle ();

下面的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

能够用来修饰interface的有()

A. private
B. public
C. protected
D. static

答案查题题库