题目内容 (请给出正确答案)
[单选题]

如果在Main.java中编写如下程序代码public class Main{ public static void main(string args[]){ System.out.println("Hello World"); } }以下描述正确的是

A.执行时显示Hello World

B.执行时出现NoClassDefFoundError

C.执行时出现找不到主要方法错误

D.编译失败

提问人:网友gaoxuerui 发布时间:2022-01-07
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
网友答案
查看全部
  • · 有5位网友选择 A,占比62.5%
  • · 有3位网友选择 B,占比37.5%
匿名网友 选择了A
[179.***.***.105] 1天前
匿名网友 选择了A
[184.***.***.182] 1天前
匿名网友 选择了A
[90.***.***.193] 1天前
匿名网友 选择了A
[179.***.***.105] 1天前
匿名网友 选择了A
[69.***.***.120] 1天前
匿名网友 选择了B
[193.***.***.157] 1天前
匿名网友 选择了A
[184.***.***.182] 1天前
匿名网友 选择了B
[30.***.***.253] 1天前
匿名网友 选择了B
[28.***.***.182] 1天前
匿名网友 选择了A
[169.***.***.194] 1天前
匿名网友 选择了A
[90.***.***.193] 1天前
匿名网友 选择了B
[193.***.***.157] 1天前
匿名网友 选择了A
[69.***.***.120] 1天前
匿名网友 选择了B
[193.***.***.157] 1天前
匿名网友 选择了A
[184.***.***.182] 1天前
匿名网友 选择了B
[30.***.***.253] 1天前
匿名网友 选择了B
[28.***.***.182] 1天前
匿名网友 选择了A
[169.***.***.194] 1天前
匿名网友 选择了A
[90.***.***.193] 1天前
匿名网友 选择了A
[179.***.***.105] 1天前
加载更多
提交我的答案
登录提交答案,可赢取奖励机会。
更多“如果在Main.java中编写如下程序代码public cl…”相关的问题
第1题
设有如下程序: public class Test5 { public static void main (String args []) { /* This is the start of a comment if (true) { Test5 = new test5(); System.out.println("Done the test"); } /* This is another comment */ System.out.println ("The end"); } } 结果为?

A、输出 "Done the test".

B、程序输出"The end"

C、程序编译错误.

D、程序输出"Done the test"和 "The end"

点击查看答案
第2题
阅读程序,给出结果。

//Sum.Java源代码

public class Sum {

public static void main(String[]args){

int j=10;

System.out.println("j is:"+j);

calculate(j);

System.out.println("At last,j is:"+j);

}

static void calculate(int j)

{

for (int i=0;i<10;i++)

j++;

System.out.println("j in calculate() is: "+j);

}

}

输出结果为:

j is:(______)

j in calculate() is :(______)

At last j is : (______)

点击查看答案
第3题
12. import java.util.*; 13. public class Explorer2 { 14. public static void main(String[] args) { 15. TreeSet <integer> s = new TreeSet <integer> (); 16. TreeSet <integer> subs = new TreeSet <integer> (); 17. for(int i = 606; i < 613; i++) 18. if(i%2 == 0) s.add(i); 19. subs = (TreeSet)s.subSet(608, true, 611, true); 20. s.add(629); 21. System.out.println(s + " " + subs); 22. } 23. } 程序运行结果是?

A、编译出错

B、运行时抛出异常

C、[608, 610, 612, 629] [608, 610]

D、[608, 610, 612, 629] [608, 610, 629]

E、[606, 608, 610, 612, 629] [608, 610]

F、[606, 608, 610, 612, 629] [608, 610, 629]

点击查看答案
第4题
阅读下段代码 import java.io.*; public class Example{ public static void main(String[] args) throws Exception { FileInputStream fis = new FileInputStream("file.txt"); FileOutputStream fos = new FileOutputStream("copy_file.txt"); int ch = 0; while((ch =fis.read())!=-1){ fos.write(ch); } fos._______; fis.close(); } } 请说出下划线上,填写的方法名称( )

A、read()

B、available()

C、close()

D、write()

点击查看答案
第5题
(字节输出流写文件)阅读下面程序:import java.io.*; public class ByteStrearnTest{ public static void main(String[] args){ int[] myArray={11,20,30,40}; try{ DataOutputStream dos=new DataOutputStream(new____("ints.dat")); for(int i=0;i<myarray.length;i+=) dos.writeint(myarray[i]); dos.close(); system.out.println("have written binary file ints.dat"); }catch(ioexception ioe){ system.out.println("ioexception"); }> A、FileOutputStream

B、ByteArrayOutputStream

C、BufferedOutputStream

D、FileWriter

点击查看答案
第6题
有以下C#程序:using System; namespace aaa { class Program { static void Main() { String str; str = Console.ReadLine(); bool a = str.Equals("a"); Console.WriteLine(a.ToString()); int b = str.Length; Console.WriteLine(b.ToString()); } } } 在程序运行时输入为: AAAAA(3个空格加5个A)则程序输出为( )。

A、0 8

B、False 8

C、-1 8

D、False 5

点击查看答案
第7题
给定以下代码,程序的运行结果是 ()public class Test { public static void main(String[] args) { String a = "Programming"; String b = new String("Programming"); String c = "Program" + "ming"; System.out.println(a == b); System.out.println(a == c); System.out.println(a.equals(b)); System.out.println(a.equals(c)); } }
点击查看答案
第8题
编译并运行下述程序段的结果是 public class Test{ public static void main(String argv[]){ int[] count = new int[4]; System.out.println(count[4]); } }

A、编译错误

B、运行错误

C、输出0

D、输出null

点击查看答案
第9题
请先阅读下面的代码。 public class Test03 { public static void main(String args[]) { int x = 4, j = 0; switch (x) { case 1: j++; case 2: j++; case 3: j++; case 4: j++; case 5: j++; default: j++; } System.out.println(j); } } 上面一段程序运行结束时,变量j的值为下列哪一项?

A、1

B、2

C、3

D、4

点击查看答案
第10题
如果有个Console类的源代码开头定义如下: package cn.nbcc; public class Console{ ... }其完全限定名是( )

A、cn.nbcc.Console

B、package cn.nbcc.Console

C、cn.nbcc

D、以上皆非

点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

为鼓励登录用户提交答案,简答题每个月将会抽取一批参与作答的用户给予奖励,具体奖励活动请关注官方微信公众号:简答题

简答题官方微信公众号

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
简答题
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
简答题
点击打开微信