题目内容 (请给出正确答案)
[主观题]

阅读下面的程序:public class test {public static void main(String args[]) {int i;float f = 2.3f;double d = 2.7;i = ((int)Math.ceil(f)) * ((int)Math.round(d));System.out.println(i);}} 程序执行后,运行结果为以下哪个选项?()

A.9

B.5

C.6

D.6.1

查看答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“阅读下面的程序:public class test {pub…”相关的问题

第1题

阅读下面的程序, 写出运行后输出的结果。 #include<iostream> using namespace std; class A { public: A(){cout<<"A";} }; class B :public A { public: B(){cout<<"B";} }; void main() { B b1; }
点击查看答案

第2题

阅读下面的程序段: publiC class Sun { public static void main (Stringargs[]) { int a=0; for

阅读下面的程序段: publiC class Sun { public static void main (String args[ ]) { int a=0; for(int i=1;i<=3;i++) { for(int j=1;j<=i;j++) { for(int k=j;k<=3;k++) { a=a+1; } } } System.out.println(A) ; } } 执行上面的3重循环后,a的值为()。

A.3

B.9

C.14

D.21

点击查看答案

第3题

阅读下面的程序, 分析代码是否能够编译通过 class A { private int secret = 5; } public class Test1 { public static void main(); } }

A.可以编译通过

B.不能编译通过

点击查看答案

第4题

阅读下面的程序:public class Person{ int arr[ ]=Hew int[10]; public static void main(String

阅读下面的程序: public class Person{ int arr[ ]=Hew int[10]; public static void main(String args[ ]){ System.out.println(arr[1]); } } 正确的说法是______。

A.编译时将产生错误

B.编译时正确,运行时将产生错误

C.输出为0

D.输出为空

点击查看答案

第5题

阅读下面的程序段:public class Sun{public static void main(String args[ ]){int a=0for(int i

阅读下面的程序段: public class Sun { public static void main(String args[ ]) { int a=0 for(int i=1;i<=3;i++) { for(int j=1;j<-i;j++) { for(int k=j;k<=3;k++) { a=a+1; } } } System.out.println(A) 我; }}执行上面的3重循环后,a的值为()。

A.3

B.9

C.14

D.21

点击查看答案

第6题

阅读下面的程序, 分析代码是否能够编译通过,如果能编译通过,请列出运行的结果。否则请说明编译失败的原因。 代码一: public class Test01 { public static void Main(); n--; } } }
点击查看答案

第7题

请阅读下面的程序,选择正确的运行结果。 class Demo{ private static int x ; public static void main(String[] args){ System.out.println(x++); } }

A.0

B.1

C.无结果

D.编译失败

点击查看答案

第8题

请阅读下面的程序,选择正确的运行结果。 class Demo{ private static int x ; public static void main(String[] args){ System.out.println(x++); } }

A.0

B.1

C.无结果

D.编译失败

点击查看答案

第9题

请阅读下面的程序,选择正确的运行结果。 class Demo{ private static int x ; public static void main(String[] args){ System.out.println(x++); } }

A.0

B.1

C.无结果

D.编译失败

点击查看答案

第10题

请阅读下面的程序,选择正确的运行结果。class Demo{ private static int x ; public static void main(String[] args){ System.out.println(x++); } }

A.0

B.1

C.无结果

D.编译失败

点击查看答案
发送账号至手机
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
温馨提示
每个试题只能免费做一次,如需多次做题,请购买搜题卡
立即购买
稍后再说
警告:系统检测到您的账号存在安全风险

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

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