java程序员面试笔试试题.docx
《java程序员面试笔试试题.docx》由会员分享,可在线阅读,更多相关《java程序员面试笔试试题.docx(9页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。
1、 java程序员面试笔试试题 一、单项选择题(共10题,每题2分,共20分) 1. 以下说法哪一个是正确的。( B ) A.Java程序经编译后会产生machine code B.Java程序经编译后会产生byte code C.Java程序经编译后会产生DLL D.以上都不正确 2. 供应Java存取数据库力量的包是。( A ) A.java.sql B.java.awt C.java.lang D.java.swing 3. 执行如下程序代码后,C的值是。( C ) a=0;c=0; do -c; a=a-1; while(a0); A.0 B.1 C.-1 D.死循环 4. 下面的语句中
2、正确的表达式为。( C ) A.byte b = 128; B.boolean n = null; C.double d = 0.9239d; D.float f = 0.9239; 5. 将一个十六进制值赋给一个long型变量的正确写法为。( D ) A.long number = 345L; B.long number = 0345; C.long number = 0345L; D.long number = 0x345L; 6. 以下程序代码的输出是。( B ) public class test ( public static void main (String args) ( Sy
3、stem.out.printIn (6 3); ) ) A.3 B.5 C.6 D.11 7. 以下程序代码的输出是。(E ) public class test ( private static int j = 0; private static boolean methodB(int k) ( j += k; return true; ) public static void methodA(int i) boolean b: b = i 10 | methodB (4); b = i 10 | methodB (8); ) public static void main (String
4、args ( methodA (0); system.out.printIn(j); ) ) A.0 B.4 C.8 D.12 E.不能编译通过 8. 以下程序代码的输出是。( A) public class test public static void add3 (Integer i) int val = i.intValue ( ); val += 3; i = new Integer (val); public static void main (String args ) Integer i = new Integer (0); add3 (i); system.out.printI
5、n (i.intValue ( ) ); ) A.编译失败 B.编译胜利但在第三行会消失特别 C.0 D.3 9. 以下程序代码执行后,哪个说法正确?( B ) int index = 1; boolean test = new Boolean3; boolean foo= test index; A.有特别抛出。 B.无法编译。 C.foo的值是0。 D.foo的值是null。 E.foo的值是true。 F.foo的值是false。 10. 以下哪个类是swt包中的。( D ) A.MessageBox B.MessageDialog C.JDialog D.DisplayMode 二、多
6、项选择题(共5题,每题4分,共20分) 1. 在下面的选项中合法的标识符有。( ADEF ) A._ok B.*point C.this D.$byte E.const F.ILikeJLCSS 2. 下面的选项中哪些不是java的关键字。( AB D ) A.TRUE B.sizeof C.goto D.const E.super F.void 3. 下面的表达中正确的有。( AC ) A. 环境变量可在编译source code时指定。 B. 在编译程序时,所能指定的环境变量不包括class path。 C. javac一次可同时编译数个Java源文件。 D. javac.exe能指定编译
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- java 程序员 面试 笔试 试题
限制150内