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

下面程序的运行结果是? public static void main(String[] args) { int x = 8; int y = 4; if(x+

下面程序的运行结果是? public static void main(String[] args) { int x = 8; int y = 4; if(x++>8 && ++y<4){ system.out.print(x); }else{ system.out.print(y); } system.out.printf("%d%d",x,y);> A、995

B、985

C、494

D、495

提问人:网友mcldaybreak 发布时间:2022-01-07
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
更多“下面程序的运行结果是? public static void…”相关的问题
第1题
下列代码的执行结果是()。 class operator Test{ public static void main(String[]args){ int x=8; short y=2; system.out.println("xis"+ x + ",yis"+y); } }

A.8和2

B.8.0和2.0

C.8和2.0

D.8.0和2

点击查看答案
第2题
下段程序的输出是( ) class Program { static void Main(string[] args) { string path = @"D:\1.txt"; FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.ReadWrite); string message = "123456789abcdefg"; byte[] info = new UTF8Encoding(true).GetBytes(message); fs.Write(info, 5, 4); fs.Flush(); fs.Close(); } }

A、6789

B、5678

C、4567

D、3456

点击查看答案
第3题
设x和y均为int型变量,则执行以下的循环后,y的值为( ) for(y=1,x=1;y<=50;y++) { if(x>=0) break; if(x%2==1) {y+=5;continue;} x-=3; }

A、5

B、3

C、2

D、1

点击查看答案
第4题
public class xiti { Integer i; int x; public xiti(int y) { x=i+y; System.out.println(x); } public static void main(String[] args) { new xiti(new Integer(4)); } } 下面程序运行的结果是:

A、4

B、8

C、编译错误,程序无法运行

D、编译正确,程序运行出错

点击查看答案
第5题
在Java中,以下程序编译运行后的输出结果为()publicclassTest{intx,y;Test(intx,inty){this.x=x;this.y=y;}publicstaticvoidmain(String[]args){Testpt1,pt2;pt1=newTest(3,3);pt2=newTest(4,4);System.out.print(pt1.x+pt2.x);}}
A.34

B.7

C.8

D.6

点击查看答案
第6题
请说出该程序段的功能。

declare @e numeric(5,2)

declare @ c1 int, @ c2 int, @ c3 int, @ c4 int

set @ c1=0; set @ c2 =0; set @ c3=0; set @ c4=0

declare xxx cursor

for select 成绩 from score

open xxx

fetch xxx into @ c

while @'@ fetch_status = 0

begin

if(@c > =90) set @cl =@ e1 +1;

else if(@ c > =70) set @ c2 =@ c2 +1;

else if(@ c> =60) set @ c3 =@ c3 +1;

else set @ c4 = @ c4 + 1

fetch from xxx into @ c

end

close xxx

deallocate xxx

print 优秀生人数:'+sb(@ c1,5);

print食好生人数:'+str(@ c2,5);

print及格生人数:'+str(@ c3,5);

print及格生人数:'+sh(@ c4,5)

点击查看答案
第7题
int[] nums = new int[4]; try { System.out.println("字符串1"); nums[4] = 10; System.out.println("字符串2"); } catch (ArrayIndexOutOfBoundsException ex) { System.out.println("字符串3"); }finally{ System.out.println("字符串4"); } 上述代码输出结果为()

A、字符串1 字符串2 字符串3 字符串4

B、字符串1 字符串2 字符串3

C、字符串1 字符串2 字符串4

D、字符串1 字符串3 字符串4

点击查看答案
第8题
下面程序的运行结果是 main(){ int a[][] ={{1,2,3},{4,5,6}}; system.out.println(a[1][1]); }

A、3

B、4

C、5

D、6

点击查看答案
第9题
下列程序运行的结果是 _____。 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; } } }
点击查看答案
第10题
假如s1和s2是两个String类型的字符串,请问下列语句或表达式哪个是错误的

A、s1.equals(s2)

B、char c = s1.charAt(0)

C、String s3=s1+s2

D、String s3=s1-s2

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

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

简答题官方微信公众号

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

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

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