Java考试资料(考试试卷三).doc_第1页
Java考试资料(考试试卷三).doc_第2页
Java考试资料(考试试卷三).doc_第3页
Java考试资料(考试试卷三).doc_第4页
Java考试资料(考试试卷三).doc_第5页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

装订线内不要答题,装订线外不要写姓名、学号、学院专业年级班签个人信息,违者试卷作0分处理考 点 号教 室 号姓 名学 院专 业年 级班 号学号(全号)湖南农业大学课程考核试卷课程名称(全称):Java程序设计(双语) 课程代码:20638B0考核时间:2011 年01月 04 日 试卷号 : B 考核对象:电子商务081、电子商务082大题号一二三四五六七八九十总分题分202020101020得分 得分I、Choose one correct answer(Total 30 points,each question 3 points)1. Which of the following are Java modifiers? ( )A. public B. true C. friendly D. transient2. Choose the valid identifier from those listed below. ( ) A. MyMethod B. 3byte C. 5_const D.true3. ( ) is a set of primitive instructions built into every computer? A. The machine language B. Assembly language C. The low-level language D. The high-level language 4. What is the return value of the main() method in Java? ( )A. String B. int C. char D. void5. Which is not valid Java keyword? ( )A. const B. NULL C. false D. this6. Which of the following assignments is NOT legal? ( )A.float a = 2.0 B.double b = 2.0 C.int c = 2 D.long d = 27. Which is not a high-level language? ( )A. c language B. BASIC languageC. Visual BASIC language D. Assembly language8. Given the following code:switch (m) case 0: System.out.println(Condition 0); case 1: System.out.println(Condition 1); case 2: System.out.println(Condition 2); case 3: System.out.println(Condition 3);break; default: System.out.println(Other Condition);Which values of m will cause Condition 2 is output? ( )A. 0,1 and 2 B. only 1 C. 3 D. 49. Which modifier is NOT legal in Java? ( )A. private B. public C. protected D. protect10. There are three editions of the Java API except ( )A. J2SE B. J2EE C. J2ME D. J2NE得分II、Decide correct or wrong(Total 20 points,each question 2 points, “”means right, “X” means wrong)1、Java is a kind of Object-oriented programming language.( ) 2、basic is a high-level language.( ) 3、A local variable must be declared before it can be used.()4、The solution of overloading methods is to create another method with the same name but different parameters.()5、compilation errors occur when a program does not perform the way it was intended to.()6、You can declare a local variable with the same multiple times in different non-nesting blocks in a method.( )7、“=” and “euqals()” are the same.()8、break immediately ends the innermost loop that contain it.()9、Letter A and letter a are the same in Java.()10、You can use the keyword new to create an instance object of a class.( )得分III、Fill the following blanks(Total 20 points,each blank 2 points)1Public class TestMax public static void main(String args) int i=5; int j=2; int k=max(i,j) System.out.println(“The maximum between ” + i + “and “ + j +”is ” + k); public static (int num1, int num2) int result; if (num1 num2) result = ; else result = ; return ; 2switch(m) 0: System.out.println(case 0! ); 1: System.out.println(case 1! ); break;default: System.out.println(default!);(1)when m=0 , the result is: (2)when m=1, the result is: (3)when m3, the result is: _得分IV、Write the results after code is executed.(Total 10 points,each question 5 points)1int i=0; while (i =10) i+;System.out.println(i is + i);The result of question 1 is : 2public class TestpassByValue public static void main ( String args) int num1=1; int num2=2; swap(num1,num2); System.out.println(num1,num2) public static void swap(int n1, int n2) int temp=1;n1=n2;n2=temp;The result of question 2 is : 得分V、answer questions briefly(Total 10 points,each question 5 points)1. Answer the characteristics of Java briefly.2. Answer the rule of evaluating an expression.得分VI、programming(Total 20 points,each question 20 points)1Please write a Java program,compute the GreatestCommmonDivisor.2Please write a Jav

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论