电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

2025年上海继续教育JAVA作业1上课讲义

2025年上海继续教育JAVA作业1上课讲义_第1页
1/12
2025年上海继续教育JAVA作业1上课讲义_第2页
2/12
2025年上海继续教育JAVA作业1上课讲义_第3页
3/12
1、下面的程序经运行后,其输出成果是( )public class Yuedu1 { public static void main(String[] args) { int x,y; x=y=0; do{ y++; x*=x; } while ((x>0)&&(y>5)); System.out.println("y="+y+" x="+x); }}选择一项:a. y=1 x=0 b. y=0 x=1 c. y=1 x=1 d. y=0 x=0 题目 2、Java application 中的主类需包含 main 措施,main 措施的返回类型是什么?( )选择一项:a. void b. double c. int d. float 题目 3、不对的下列语句序列执行后,r 的值是( )。 char ch='8'; int r=10; switch( ch+1 ) { case '7': r=r+3; case '8': r=r+5; case '9': r=r+6; break; default: r=r+8; }选择一项:a. 15 b. 18 c. 16 d. 13 题目 4、不对的编译、运行下面代码将发生什么?( )public class Test5 {public static void main (String args []) {/* This is the start of a commentSystem.out.println("Done the test");/* This is another comment */System.out.println ("The end");}} 选择一项:a. 输出“The end”。 b. 输出“Done the test”。 c. 程序运行出错。 d. 输出“Done the test”和“The end”。 题目 5、下面的程序经运行后,其输出成果是( )public class Yuedu1 { public static void main(String[] args) { int i; for(i=1;i<6;i++) { if(i%2==1) { System.out.print("#"); continue; } System.out.print("*"); } System.out.println(); }}选择一项:a. #*#* b. #*#*# c. *#*#* d. *#*# 6、下面程序的执行成果是( )int i = 9;switch (i) {default:System.out.print("default,");case 0:System.out.println("zero");break;case 1:System.out.println("one");case 2:System.out.println("two");}选择一项:a. default b. error default clause not defined c. no output displayed d. default, zero 题目 7、main()措施是 java Application 程序执行的起始点,如下( )的 main( )措施头部是合法的选择一项:a. public void main(String args[ ]) b. public static void main() c. public static int main(String args[ ]) d. public static void main(String args[ ]) 题目 8 不对的下面的逻辑体现式中合...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

2025年上海继续教育JAVA作业1上课讲义

您可能关注的文档

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部