网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
多选题
10. class MakeFile { 11. public static void main(String[] args) { 12. try { 13. File directory = new File(”d”); 14. File file = new File(directory,”f”); 15. if(!file.exists()) { 16. file.createNewFile(); 17. } 18. } catch (IOException e) { 19. e.printStackTrace 20. } 21. } 22. } The current directory does NOT contain a directory named “d.” Which three are true?()
A
Line 16 is never executed.
B
An exception is thrown at runtime.
C
Line 13 creates a File object named “d”.
D
Line 14 creates a File object named “f‟.
E
Line 13 creates a directory named “d” in the file system.
F
Line 16 creates a directory named “d” and a file “f” within it in the file system.
G
Line 14 creates a file named f inside of the directory named “d” in the file system.
参考答案
参考解析
解析:
暂无解析
更多 “多选题10. class MakeFile { 11. public static void main(String[] args) { 12. try { 13. File directory = new File(”d”); 14. File file = new File(directory,”f”); 15. if(!file.exists()) { 16. file.createNewFile(); 17. } 18. } catch (IOException e) { 19. e.printStackTrace 20. } 21. } 22. } The current directory does NOT contain a directory named “d.” Which three are true?()ALine 16 is never executed.BAn exception is thrown at runtime.CLine 13 creates a File object named “d”.DLine 14 creates a File object named “f‟.ELine 13 creates a directory named “d” in the file system.FLine 16 creates a directory named “d” and a file “f” within it in the file system.GLine 14 creates a file named f inside of the directory named “d” in the file system.” 相关考题
考题
下列程序的运行结果是【 】。public class Test {public static void main (String args[]) {String s1="hello!";System.out.println (s1.toUpperCase());}}
考题
以下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)
考题
下列哪个是对main( )主方法的正确表示?A.public void static main(String args[ ]){ ... }B.void public static main(String args[ ]){ ... }C.static public void main(String args[ ]){ ... }D.以上都不正确
考题
interface A{int x = 0;}class B{int x =1;}class C extends B implements A {public void pX(){System.out.println(x);}public static void main(String[] args) {new C().pX();}}
考题
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方法是JavaApplication程序执行的入口点。关于main方法的方法头,下列合法的是( )。A.public static void main()B. public static void main(String[])args)C. public static iht main(String[]arg)D.public void main(String arg[])
考题
下列( )是对main ()主方法的正确表示。A.public void static main (String args []) {…}B.void public static main (String args []) {…}C.static public void main (String args []) {…}D.以上都不正确
考题
以下哪个是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[] );
考题
以下是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[])
考题
Public class test ( Public static void main (String args[]) ( System.out.printIn (6 ^ 3); ) ) What is the output?()
考题
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?()
考题
下列有关main()方法的签名正确的是哪些?()A、 public static void main(String[] args){}B、 public static void main(){}C、 public static void main(String args[]){}D、 public void static main(String[] args){}
考题
下面哪些选项是正确的main方法说明?()A、 public main(String args[])B、 public static void main(String args[])C、 private static void main(String args[])D、 void main()
考题
下面关于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 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?() A、 The program runs and prints “Hello”B、 An error causes compilation to fail.C、 The program runs and prints “Hello world!”D、 The program runs but aborts with an exception.
考题
下面哪些main方法可用于程序执行()A、public static void main(String[]args)B、public static void main(String[]x)C、public static void main(Stringargs[])D、public void main(String[]args)
考题
多选题Which declarations will allow a class to be started as a standalone program?()Apublic void main(String args[])Bpublic void static main(String args[])Cpublic static main(String[] argv)Dfinal public static void main(String [] array)Epublic static void main(String args[])
考题
单选题以下是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 main (String args) ( System.out.printIn (6^3); ) ) What is the output? ()
考题
填空题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?()
考题
单选题1. class Pizza { 2. java.util.ArrayList toppings; 3. public final void addTopping(String topping) { 4. toppings.add(topping); 5. } 6. } 7. public class PepperoniPizza extends Pizza { 8. public void addTopping(String topping) { 9. System.out.println(”Cannot add Toppings”); 10. } 11. public static void main(String[] args) { 12. Pizza pizza = new PepperoniPizza(); 13. pizza.addTopping(”Mushrooms”); 14. } 15. } What is the result?()A
Compilation fails.B
Cannot add ToppingsC
The code runs with no output.D
A NullPointerException is thrown in Line 4.
考题
填空题1. public class test { 2. public static string output = “” 3. 4. public static void foo(int i) { 5. try { 6. if(i= =1) { 7. throw new Exception (); 8. } 9. output += “1”; 10.} 11. catch(Exception e) { 12. output += “2”; 13. return; 14.} 15. finally ( 16. output += “3”; 17. ) 18. output += “4”; 19. } 20. 21. public static void main (string args[]) ( 22. foo(0); 23. foo(1); 24. 25. ) 26. } What is the value of the variable output at line 24?()
考题
单选题下面哪些选项是正确的main方法说明?()A
public main(String args[])B
public static void main(String args[])C
private static void main(String args[])D
void main()
热门标签
最新试卷