The program prints “lava”
The program prints “java”
An error at line 7 causes compilation to fail.
Compilation succeeds but the program throws an exception.
第1题:
Which declarations will allow a class to be started as a standalone program?()
第2题:
class Super { public int i = 0; public Super(String text) { i = 1; } } public class Sub extends Super { public Sub(String text) { i = 2; } public static void main(String args[]) { Sub sub = new Sub(“Hello”); System.out.println(sub.i); } } What is the result?()
第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?()
第4题:
声明Java独立应用程序main()方法时,正确表达是()。
第5题:
public class Test { public static void leftshift(int i, int j) { i<<=j; } public static void main(String args[]) { int i = 4, j = 2; leftshift(i, j); System.out.printIn(i); } } What is the result?()
第6题:
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.printLn (textString + textBuffer); ) ) What is the output?()
第7题:
下面哪些main方法可用于程序执行()
第8题:
第9题:
public void main(String args[])
public void static main(String args[])
public static main(String[] argv)
final public static void main(String [] array)
public static void main(String args[])
第10题:
0
1
2
Compilation fails.
第11题:
public static void main(String[] args){}
public static void main(String args){}
public void main(String[] args){}
public static int main(String[] args){}
第12题:
第13题:
Public class test ( Public static void main (String args[]) ( System.out.printIn (6 ^ 3); ) ) What is the output?()
第14题:
下列有关main()方法的签名正确的是哪些?()
第15题:
作为Java应用程序入口的main方法,其声明格式可以是()。
第16题:
public class Test { public static void main( String[] args) { String foo = args[1]; String bar = args[2]; String baz = args[3]; System.out.println(“baz = “ + baz); } } And the command line invocation: java Test red green blue What is the result?()
第17题:
public class X { public static void main (String[]args) { string s = new string (“Hello”); modify(s); System.out.printIn(s); } public static void modify (String s) { s += “world!”; } } What is the result?()
第18题:
public class Test { public static void replaceJ(string text) { text.replace (‘j’, ‘l’); } public static void main(String args[]) { string text = new String (“java”) replaceJ(text); system.out.printIn(text); } } What is the result?()
第19题:
class super ( public int I = 0; public super (string text) ( I = 1 ) ) public class sub extends super ( public sub (string text) ( i= 2 ) public static void main (straing args) ( sub sub = new sub (“Hello”); system.out. PrintIn(sub.i); ) ) What is the result?()
第20题:
第21题:
Compilation will fail.
Compilation will succeed and the program will print “0”
Compilation will succeed and the program will print “1”
Compilation will succeed and the program will print “2”
第22题:
The program runs and prints “Hello”
An error causes compilation to fail.
The program runs and prints “Hello world!”
The program runs but aborts with an exception.
第23题:
2
4
8
16
The code will not compile.
第24题:
The program prints “lava”
The program prints “java”
An error at line 7 causes compilation to fail.
Compilation succeeds but the program throws an exception.