单项选择题
Which will declare a method that is available to all members of the same package and can be referenced without an instance of the class?()
A. Abstract public void methoda();
B. Public abstract double methoda();
C. Static void methoda(double d1){}
D. Public native double methoda() {}
E. Protected void methoda(double d1) {}
点击查看答案&解析
相关考题
-
单项选择题
//point X public class foo { public static void main (String[]args) throws Exception { java.io.printWriter out = new java.io.PrintWriter { new java.io.outputStreamWriter (System.out), true; out.printIn(“Hello”); } } } Which statement at PointX on line 1 allows this code to compile and run?()
A. Import java.io.*;
B. Include java.io.*;
C. Import java.io.PrintWriter;
D. Include java.io.PrintWriter;
E. No statement is needed. -
单项选择题
public class Foo { public void main (String [] args) { system.out.printIn(“Hello World.”); } } What is the result?()
A. An exception is thrown.
B. The code does no compile.
C. “Hello World.” Is printed to the terminal.
D. The program exits without printing anything. -
单项选择题
1. public class Test { 2. public static void main (String []args) { 3. unsigned byte b = 0; 4. b--; 5. 6. } 7. } What is the value of b at line 5?()
A. -1
B. 255
C. 127
D. Compilation will fail.
E. Compilation will succeed but the program will throw an exception at line 4.
