单项选择题X 纠错
A. Import java.io.PrintWriter;
B. Include java.io.PrintWriter;
C. Import java.io.OutputStreamWriter;
D. Include java.io.OutputStreamWriter;
E. No statement is needed.
你可能喜欢
单项选择题
A. Compilation succeeds.
B. An error at line 2 causes compilation to fail.
C. An error at line 9 causes compilation to fail.
D. An error at line 10 causes compilation to fail.
E. An error at line 11 causes compilation to fail.
单项选择题
A. InsideOnew ei= eo.new InsideOn();
B. Eo.InsideOne ei = eo.new InsideOne();
C. InsideOne ei = EnclosingOne.new InsideOne();
D. EnclosingOne.InsideOne ei = eo.new InsideOne();
单项选择题
A. An instance of the Inner class can be constructed with “new Outer.Inner()”
B. An instance of the inner class cannot be constructed outside of package foo.
C. An instance of the inner class can only be constructed from within the outer class.
D. From within the package bar, an instance of the inner class can be constructed with “new inner()”
单项选择题
A. An anonymous inner class may be declared as final.
B. An anonymous inner class can be declared as private.
C. An anonymous inner class can implement multiple interfaces.
D. An anonymous inner class can access final variables in any enclosing scope.
E. Construction of an instance of a static inner class requires an instance of the enclosing outer class.
多项选择题
A. public interface Person{} public class Employee extends Person{}
B. public interface Shape{} public class Employee extends Shape{}
C. public interface Color{} public class Employee extends Color{}
D. public class Species{} public class Animal (private Species species;)
E. interface Component{} Class Container implements Component ( Private Component[ ] children; )
多项选择题
A. Private void setVar (int a, float c, int b) {}
B. Protected void setVar (int a, int b, float c) {}
C. Public int setVar (int a, float c, int b) (return a;)
D. Public int setVar (int a, int b, float c) (return a;)
E. Protected float setVar (int a, int b, float c) (return c;)
多项选择题
A.ConstOver(){}
B.Protected int ConstOver (){}
C.Private ConstOver (int z, int y, byte x) {}
D.Public Object ConstOver (int x, int y, int z) {}
E. Public void ConstOver (byte x, byte y, byte z){}
单项选择题
A. Compilation will fail.
B. The program prints “0”.
C. The program prints “3”.
D. Compilation will succeed but an exception will be thrown at line 3.
填空题
Public class test (
Public static void stringReplace (String text) (
Text = text.replace („j„ , „i„);
)
public static void bufferReplace (StringBuffer text) (
text = text.append (“C”) )
public static void main (String args ){
String textString = new String (“java”);
StringBuffer text BufferString = new StringBuffer (“java”);
stringReplace (textString);
BufferReplace (textBuffer);
System.out.printIn (textString + textBuffer);
}
)
What is the output?()