网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
class java { public static void main(String [] java) { for (int Java = 1; Java 〈 java.length; Java++) System.out.print("java "); } } 和命令行: java java java java java 结果为:()
A
java
B
java java
C
java java java
D
编译失败
参考答案
参考解析
解析:
暂无解析
更多 “单选题class java { public static void main(String [] java) { for (int Java = 1; Java 〈 java.length; Java++) System.out.print("java "); } } 和命令行: java java java java java 结果为:()A javaB java javaC java java javaD 编译失败” 相关考题
考题
以下Java应用程序执行入口main方法的声明中,正确的是( )。
A.public static void main()B.public static void main(String[] args)C.public static int main(String[] args)D.public void main(String[] args)
考题
下列代码的输出结果是( )。class parent{void printme(){System.out.println("parent");}}class child extends parent{void printme(){System. out.println("child");}void printall(){super, printme();this.printme();printme();}}public class test{public static void main(String args[]){child myc=new child();myc.printall();}}A.import java.awt.*;B.import java.applet.applet;C.import java.io.*;D.import java, awt.graphics;
考题
main方法是Java Application程序执行的入口点,关于main方法头以下( )是合法的。A.pubUc statk void main()B.public static void main (String[]args)C.public static int main (String[]arg)D.public void main (String arg[])
考题
main方法是Java Application程序执行的入口点,关于main方法头以下( )是合法的。A.public static void main( )B.public static void main (String[ ]args)C.public static int main (String[ ]arg)D.public void main(String arg[])
考题
以下哪个是Java应用程序main方法的有效定义?
A. public static void main();B. public static void main( String args );C. public static void main( String args[] );D. public static void main( Graphics g );E. public static boolean main( String a[] );
考题
If this source code is contained in a file called SmallProg.java, what command should be used to compile it using the JDK?() public class SmallProg { public static void main(String args[]) { System.out.println("Good luck!"); } } A、java SmallProgB、avac SmallProgC、javac SmallProg.javaD、java SmallProg main
考题
以下是JAVA中正确的入口方法是? () A、 public static void main(String[] args){}B、 public static void main(String args){}C、 public void main(String[] args){}D、 public static int main(String[] args){}
考题
Which declarations will allow a class to be started as a standalone program?() A、public void main(String args[])B、public void static main(String args[])C、public static main(String[] argv)D、final public static void main(String [] array)E、public static void main(String args[])
考题
package com.sun.sjcp; public class Commander{ public static void main(String[]args){ //more code here } } Assume that the class fileis located in /foo/com/sun/sjcp/,the current directory is/foo/,and that the classpath contains“.“(current directory). Which command line correctly runs Commander?()A、java CommanderB、java com.sim.sjcp.CommanderC、java com/sun/sjcp/CommanderD、java-cpcom.sun.sjcp CommanderE、java-cpcom/sun/sjcp Commander
考题
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?()
考题
public class test { public static void main(String [] a) { assert a.length == 1; } } Which two will produce an AssertionError?()A、 java testB、 java -ea testC、 java test file1D、 java -ea test file1E、 java -ea test file1 file2F、 java -ea:test test file1
考题
下面关于Java应用程序中main方法的写法,合法的是()。A、public static void main()B、public static void main(Stringargs[])C、public static int main(String[]arg)D、public void main(Stringarg[])
考题
作为Java应用程序入口的main方法,其声明格式可以是()。A、public static void main(String[] args)B、public static int main(String[] args)C、public void main(String[] args)D、public int main(String[] args)
考题
main方法是Java应用程序执行的入口点,关于main方法的方法头以下哪项是合法的?()A、public static void main()B、public static void main(String[]args)C、public static int main(String[]arg)D、public void main(Stringarg[])
考题
main方法是Java程序执行的入口点,关于main方法的方法头以下哪项是合法的()?A、public static void main( )B、public static void main( String args[] )C、public static int main(String [] arg )D、public void main(String arg[] )
考题
声明Java独立应用程序main()方法时,正确表达是()。A、public static void main(String[]args){…}B、private static void main(String args[]){…}C、public void main(String args[]){…}D、public static void main(){…}
考题
public class Foo { static int[] a; static { a[0]=2; } public static void main( String[] args) {} } Which exception or error will be thrown when a programmer attempts to run this code?() A、 java.lang. StackOverflowErrorB、 java.lang.IllegalStateExceptionC、 java.lang.ExceptionlnlnitializerErrorD、 java.lang.ArraylndexOutOfBoundsException
考题
public class Test { public static void main (String[]args) { String foo = args[1]; String bar = args[2]; String baz = args[3]; System.out.printIn(“baz = ” + baz); } } And the output: Baz = 2 Which command line invocation will produce the output?() A、 Java Test 2222B、 Java Test 1 2 3 4C、 Java Test 4 2 4 2D、 Java Test 4 3 2 1
考题
class java { public static void main(String [] java) { for (int Java = 1; Java 〈 java.length; Java++) System.out.print("java "); } } 和命令行: java java java java java 结果为:() A、javaB、java javaC、java java javaD、编译失败
考题
单选题public class Test { public static void main (Stringargs) { String foo = args[1]; String bar = args; String baz = args; System.out.printIn(“baz = ” + baz); } } And the output: Baz = 2 Which command line invocation will produce the output?()A
Java Test 2222B
Java Test 1 2 3 4C
Java Test 4 2 4 2D
Java Test 4 3 2 1
考题
单选题public class MyExample{ public static void main(String args[]) { System.out.println(args[2]) }} 如果以下列命令行运行: java MyExample Aptech online 上述代码将输出()。A
MyExampleB
AptechC
OnlineD
产生异常: java.lang.ArrayIndexOutOfBoundsException
考题
单选题以下是JAVA中正确的入口方法是? ()A
public static void main(String[] args){}B
public static void main(String args){}C
public void main(String[] args){}D
public static int main(String[] args){}
考题
填空题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?()
考题
单选题public class Test { public static void main (String[]args) { String foo = args[1]; String bar = args[2]; String baz = args[3]; System.out.printIn(“baz = ” + baz); } } And the output: Baz = 2 Which command line invocation will produce the output?()A
Java Test 2222B
Java Test 1 2 3 4C
Java Test 4 2 4 2D
Java Test 4 3 2 1
考题
单选题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?()A
The program prints “lava”B
The program prints “java”C
An error at line 7 causes compilation to fail.D
Compilation succeeds but the program throws an exception.
考题
单选题class java { public static void main(String [] java) { for (int Java = 1; Java 〈 java.length; Java++) System.out.print("java "); } } 和命令行: java java java java java 结果为:()A
javaB
java javaC
java java javaD
编译失败
考题
单选题public class Foo { static int[] a; static { a[0]=2; } public static void main( String[] args) {} } Which exception or error will be thrown when a programmer attempts to run this code?()A
java.lang. StackOverflowErrorB
java.lang.IllegalStateExceptionC
java.lang.ExceptionlnlnitializerErrorD
java.lang.ArraylndexOutOfBoundsException
热门标签
最新试卷