搜题
网友您好,请在下方输入框内输入要搜索的题目:
搜题
题目内容 (请给出正确答案)
提问人:网友qiwa2006 发布时间:2022-01-07
[主观题]

import java.io.* ; public class abc { public static void main(String args[ ]) { inti,s=0;

2、import java.io.* ; public class abc { public static void main(String args[ ]) { inti,s=0; int a[1={10,20,30,40,50,60,70, 80,90 }; for(i=0;i<a.length;i++) if (a[i]%3="=0g+=a[i]" ; system.out.printin("s="+s); } }<br><p class=" answer">

3、3、import java.io.* ; public class abc { public static void main(String args[ ]) { System.out.println("a="+a+"\nb="+b); } } class SubClass extends SuperClass { int c; SubClass(int aa, int bb, int cc) { super(aa, bb); C=CC; } } class SubSubClass extends SubClass { int a; SubSubClass(int aa, int bb, int cc) {super(aa, bb, Cc); A = aa+bb+cc; } void show() { System.out.println("a="+a+"’nb="+b+"nc="+c); } }

简答题官方参考答案 (由简答题聘请的专业题库老师提供的解答)
  抱歉!暂无答案,正在努力更新中……
更多“import java.io.* ; public class abc { public static void main(String args[ ]) { inti,s=0;”相关的问题
第1题
(File类)下列程序运行后的结果可能是________。import java. io. *; public class Test { public static void main (String [] args) { File file =new File ( "hello . txt" ) ; if (file. exists () ) { file.delete () ; } else { try { file . createNewFile ( ) ; } catch (Exception e ) { e .printStackTrace ( ) ; } } } }

A、如果文件不存在 ,则程序退出

B、如果文件已经存在 , 则程序退出

C、如果文件已经存在,则保留该文件

D、如果文件不存在 , 则创建该文件

点击查看答案
第2题
下列程序运行后的结果可能是() import java. io. * ; public class test01 { public static void main (String [] args) { File file =new File ( "hello . txt " ) ; if (file . exists () ) { file .delete () ; } else { try { file . createNewFiile ( ) ; } catch (Exception e ) { e .printStackTrace ( ) ; } } } }

A、如果文件不存在 ,则程序退出

B、如果文件已经存在 , 则程序退出

C、如果文件已经存在 , 则保留该文件

D、如果文件不存在 , 则创建该文件

点击查看答案
第3题

import java.io.*; public class ABC { public static void main(String args[]) throws Exception { int i, n = 3, a = 0, b = 0, temp = 0; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); a = b = Integer.parseInt(br.readLine()); for (i = 0; i <= n; i++) { temp="Integer.parseInt(br.readLine());" if (temp> a) a = temp; if (temp < b) b = temp; } System.out.println("a=" + a + "\nb=" + b); } } 运行代码,输入3↓ 24 ↓ 96↓ 25↓后的输出结果是: 备选答案:A.a=3↓b=96 B. a=96↓b=3 C.a=25↓b=3 D.a=24↓b=25

点击查看答案
第4题
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]

点击查看答案
第5题
给定以下代码,程序的运行结果是 ()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)); } }
点击查看答案
第6题
阅读下面程序,判断它的输出结果?PublicclassHello{publicstaticvoidmain(Stringargs[]){inti=0;Stringstr[]={"11","22"};while(i<3){System.out.print(str[i]);i++;}}}

A、1122

B、1122java.lang.ArrayIndexOutOfBoundsException:2atHello.main...

C、java.lang.ArrayIndexOutOfBoundsException:2atHello.main...

D、1122Error!

点击查看答案
第7题

有下面代码import java.util.*; class Student { int age; String name; public Student(){} public Student(String name, int age){ this.name = name; this.age = age; } public int hashCode(){ return name.hashCode() + age; } public boolean equals(Object o){ if (o == null) return false; if (o == this) return true; if (o.getClass() != this.getClass()) return false; Student stu = (Student) o; if (stu.name.equals(name) && stu.age == age) return true; else return false; } } public class TestHashSet{ public static void main(String args[]){ Set set = new HashSet(); Student stu1 = new Student(); Student stu2 = new Student(“Tom”, 18); Student stu3 = new Student(“Tom”, 18); set.add(stu1); set.add(stu2); set.add(stu3); System.out.println(set.size()); } } 下列说法正确的是?

A、编译错误

B、编译正确,运行时异常

C、编译运行都正确,输出结果为3

D、编译运行都正确,输出结果为2

点击查看答案
第8题
def f(*args,a): print(a,args) f(1,2,3) 结果是

A、3 [1,2]

B、3 (1,2)

C、1 (2,3)

D、错误

点击查看答案
第9题
设有如下程序: 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"

点击查看答案
第10题
import java.util.*; public class TestListSet{ public static void main(String args[]){ List list = new ArrayList(); list.add(“Hello”); list.add(“Learn”); list.add(“Hello”); list.add(“Welcome”); Set set = new HashSet(); set.addAll(list); System.out.println(set.size()); } } 选择正确答案。

A、编译不通过

B、编译通过,运行时异常

C、编译运行都正常,输出3

D、编译运行都正常,输出4

点击查看答案
重要提示: 请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案
购买前请仔细阅读《购买须知》
请选择支付方式
微信支付
支付宝支付
点击支付即表示你同意并接受《服务协议》《购买须知》
立即支付
搜题卡使用说明

1. 搜题次数扣减规则:

功能 扣减规则
基础费
(查看答案)
加收费
(AI功能)
文字搜题、查看答案 1/每题 0/每次
语音搜题、查看答案 1/每题 2/每次
单题拍照识别、查看答案 1/每题 2/每次
整页拍照识别、查看答案 1/每题 5/每次

备注:网站、APP、小程序均支持文字搜题、查看答案;语音搜题、单题拍照识别、整页拍照识别仅APP、小程序支持。

2. 使用语音搜索、拍照搜索等AI功能需安装APP(或打开微信小程序)。

3. 搜题卡过期将作废,不支持退款,请在有效期内使用完毕。

请使用微信扫码支付(元)

订单号:

遇到问题请联系在线客服

请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示:请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
警告:系统检测到您的账号存在安全风险

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

- 微信扫码关注简答题 -
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
- 微信扫码关注简答题 -
请用微信扫码测试
欢迎分享答案

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

简答题官方微信公众号

简答题
下载APP
关注公众号
TOP