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

运行下面程序后,正确的输出结果是()。 public class Sun { public static void main(String args[

运行下面程序后,正确的输出结果是()。

public class Sun

{

public static void main(String args[ ])

{

int x=6;

if(x>6)

System.out.println("x>6");

else

if(x<8)

System.out.println("x<8");

else

if(x==6)

System.out.println("x=6");

}

}

A.x<8x=6

B.x<8

C.x=6

D.x<8或x=6

提问人:网友wadehua9742 发布时间:2022-01-07
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
更多“运行下面程序后,正确的输出结果是()。 public cla…”相关的问题
第1题
下面程序的输出结果是: #include <stdio.h> void inc ( void ) { static int x = 0; x++; printf ( "(%d)", x ); } main( ) { inc ( ); inc ( ); }

A、(1)(1)

B、(2)(2)

C、(1)(2)

D、(0)(1)

点击查看答案
第2题
public class Test2 { public static void main(String[] args) { int arr[]={7,6,15,4,3,12,1}; find(arr); show(arr); } public static void show(int a[]){ for(int i=0;i<a.length;i++) { if(a[i]> 6) System.out.print("a["+i+"]:"+a[i]+","); } } public static void find(int a[]){ int max=0; for(int i=0;i <a.length;i++) { max="a[i];" system.out.println("max:"+a[i]); } 执行结果: ________>
点击查看答案
第3题
public class ArrayTest{ public static void main ( String args[] ) { String s[] = new String[5]; System.out.println(s[0]); } } 哪个叙述为真?

A、运行出错

B、输出 0

C、输出 null

D、出现编译错误

点击查看答案
第4题
下列程序运行的结果是 _____。 public class function { public static void main(String[] args) { System.out.println(fun(3)); } static int fun(int n) { if(n>2) { return (fun(n-1)+fun(n-2)); }else { return 2; } } }
点击查看答案
第5题
下列程序的运行结果是( )。 Public class sun { Public static void main(String args[]) { int x=4,y=0; if(Math.pow(X,2)= =16) y—x ; if(Math.pow(X,2)<15) y—l/x; if(Math.pow(X,2)>15) y=(int)Math.pow(X,2)+1; system.out.println(y); } }

A.4

B.17

C.18

D.0.25

点击查看答案
第6题
用语言描述下面的程序:namespace StringTest{ class Program { static void Main(string[] args) { int nResult = 0; bool bResult = false; string str = "hello everyOne!!"; bResult = str.Contains("e"); Console.WriteLine("Contains(\"e\") = " + bResult); nResult = str.IndexOf("e"); Console.WriteLine("IndexOf(\"e\") = " + nResult); nResult = str.LastIndexOf("e"); Console.WriteLine("LastIndexOf(\"e\") = " + nResult); } } }
点击查看答案
第7题
请阅读下面的程序 class WhileDemo4 { public static void main(String[] args) { int n = 5; while (n > 10) { System.out.print(n); n++; } } } 下列选项中,哪一个是程序运行的结果

A、无输出

B、输出56789

C、死循环

D、编译错误

点击查看答案
第8题
运行以下代码: public class StringRef{ public static void main(String[] args){ String s1=”abc”; String s2=”def”; String s3=s2; s2=”ghi”; System.out.println(s1+s2+s3); } } 运行结果是( )。

A、abcdefghi

B、abdefdef

C、abcghidef

D、abcghighi

点击查看答案
第9题
写出下面程序的运行结果,了解while语句的使用。public class Useli3 { public static void main(String args[ ]){ int n = 9; while(n>6){ n--; System.out.print(n); } } }
点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

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

简答题官方微信公众号

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

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

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