题目内容

You need to create a class to store information about books contained in a library. What variable scope is best suited for the variable that will store the title of a book

A. Local variable
B. Static variable
C. Global variable
D. Method parameter
E. Instance variable

查看答案
更多问题

A method needs to be created that accepts an array of floats as an argument and does not return any variables. The method should be called setPoints. Which of the following method declarations is correct

A. setPoints(float[] points) {...}
B. void setPoints(float points) {...}
C. void setPoints(float[] points) {...}
D. float setPoints(float[] points) {...}

What is the effect of the following line of code super()

A. The method that is overridden by the current method is called.
B. The parent class’s constructor is called.
C. The current class’s constructor is called.
D. The child class’s constructor is called
E. The current method is recursively called.

What is the output of the following code segment ArrayList <String> sampleArrayList = new ArrayList <String>(); sampleArrayList.add ("One"); sampleArrayList.add ("Two"); sampleArrayList.add (1, "Three"); for(String s : sampleArrayList) { System.out.print(s+" "); }

A. One Two Three
B. One Three Two
C. Three One Two
D. One Three
E. Three Two
F. A compile time error will be generated.
G. A runtime exception will be thrown.

中国陆地面积最大的省级行政单位是:( )

A. 内蒙古自治区
B. 新疆维吾尔自治区
C. 海南省
D. 广西壮族自治区

答案查题题库