软件学院实习测试试卷.doc

上传人:pu****.1 文档编号:552680701 上传时间:2022-09-12 格式:DOC 页数:26 大小:185.01KB
返回 下载 相关 举报
软件学院实习测试试卷.doc_第1页
第1页 / 共26页
软件学院实习测试试卷.doc_第2页
第2页 / 共26页
软件学院实习测试试卷.doc_第3页
第3页 / 共26页
软件学院实习测试试卷.doc_第4页
第4页 / 共26页
软件学院实习测试试卷.doc_第5页
第5页 / 共26页
点击查看更多>>
资源描述

《软件学院实习测试试卷.doc》由会员分享,可在线阅读,更多相关《软件学院实习测试试卷.doc(26页珍藏版)》请在金锄头文库上搜索。

1、软件学院实习测试试卷(第1页至第17页为试题,第18页至第26页为答题纸,请在答题纸上作答)一.判断题 1. An inherited class can access a protected member as well as a public member. True False2. It is very common to use composition and inheritance together. True False3. Object references that are fields in a class can be automatically initialized t

2、o null. True False 4. For Java access specifier, the default access is commonly referred to as package access.True False5. Unless you explicitly inherit from some other class, you implicitly inherit from Javas standard root class Object.True False6. Upcasting is always safe because youre going from

3、a more specific type to a more general type. True False7. The finally clause is necessary when you need to set something other than memory back to its original state. True False 8. Container classes can hold only references to Objects. An array, however, can be created to hold primitives directly, a

4、s well as references to Objects. True False9. In a thread, yield() is useful only in rare situations, and you cant rely on it to do any serious tuning of your application. True False10. The abstract class can not be instantiated. True False 二.不定项选择题 1. Three essential features of an object-oriented

5、programming language are:a. Data abstraction;b. Inheritance;c. Polymorphism;d. Structure.2. Which of the following is not a valid Java identifier? a. my Value b. $_AAA1c. widthd. m_x3. Where storage lives (select all the possibility)? a. Registers. b. The stack.c. The heap. d. Static storage. 4. A p

6、ackage is: a. A directory structure used to organize classes and interfaces.b. A mechanism for software reuse.c. A group of related classes and interfaces.d. All of the above.5. Classes and methods are declared final for all but the following reasons: a. final methods allow inlining the code.b. fina

7、l methods and classes prevent further inheritance.c. final methods are static.d. final methods can improve performance.6. Which of the following promotions of primitive data types is NOT allowed to occur? a. char to int.b. int to double.c. short to long. d. double to int.7. Following the standard I/

8、O model, Java has: a. System.in, b. System.out, c. System.err, d. All of the aboves.8. An interface can also contains fields, but these are automaticallya. static b. inlinec. public d. final9. Placing an object of a class inside another new class is calleda. composition b. inheritance c. polymorphis

9、m d. abstraction 10. What is the result of the right expression: (7 10 ? 2 * 100 :2 * 10)a. 200 b. 20c. true d. false三. 单项选择题1. 二进制数101110转换为等值的八进制数是 。A.45B.56C.67D.782. 以下的for循环 。for(x=0,y=0; (y!=123)&(x4); x + + );A.是无限循环 B.循环次数不定 C.执行4次 D.执行3次3. C语言中 。A.不能使用do-while语句构成的循环 B.do-while语句构成的循环必须用bre

10、ak语句才能退出C.do-while语句构成的循环,当while语句中的表达式值为非零时结束循环D.do-while语句构成的循环,当while语句中的表达式值为零时结束循环4. 下面各语句行中,能正确进行赋字符串操作的语句行是A.char st45=ABCDE; B.char s5=A,B,C,D,E;C.char *s; s=ABCDE; D.char *s; scanf(%s,s);5. 以下for语句构成的循环执行了 次。# include # define N 2# define M N+1# define NUM (M+1)*M/2main() int i , n=0;for (

11、i=1;i=NUM;i + + );n + + ; printf(%d,n); printf(n); A. 5 B.6 C. 8 D. 96. 若要用下面的程序片段使指针变量p指向一个存储整型变量的动态存储单元:int *p;p=_ malloc( sizeof(int);则应填入A.int B.inst * C.(*int) D.(int *)7. 设有以下语句,则不是对a数组元素的正确引用,其中0i10。int a10=0,1,2,3,4,5,6,7,8,9, *p=a;A.ap-a B.*(&ai) C. pi D.*(*(a+i)8. 设有以下定义:int a43=1,2,3,4,5,

12、6,7,8,9,10,11,12;int (*prt)3=a,*p=a0;则下列能够正确表示数组元素a12的表达式是 A. *(*prt+1) 2) B.*(*(p+5) C.(*prt+1)+2 D. *(*(a+1)+2)9. 在执行以下程序时,如果从键盘上输入,ABCdef,则输出为 A. ABCdef B.abcDEF C.abc D.DEF#includemain() char ch;while(ch=getchar()!=n) if(ch=A & ch=a & ch=z) ch=ch-32;printf(%c,ch);printf(n);10. 假定以下程序经编译和连接后生成可执行

13、文件PROG.EXE,如果在此可执行文件所在目录的DOS提示符下键入:PROG ABCDEFGH IJKL,则输出结果为 A.ABCDEFG B.IJHL C.ABCDEFGHIJKL D.IJKLABCDEFGHmain( int argc, char *argv) while(-argc0) printf(“%s”,argvargc);printf(“n”);11. 有以下程序:#includeunion pw int i; char ch2; a;main() a.ch0=13; a.ch1=0; printf(%dn,a.i); 程序的输出结果是 。(注意: ch0在低字节,ch1在高字节。)A.13 B.14 C.208 D.20912. 设有以下语句: char str1=string,str28,*str3,*str4=string;则 不

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号