文档介绍:java 笔试题以及答案详解一一、单项选择题 1. Java 是从()语言改进重新设计。 A. Ada B. C++ C. Pasacal D. BASIC 答案: () A. Java 程序经编译后会产生 machine code B. Java 程序经编译后会产生 byte code C. Java 程序经编译后会产生 DLL : () A. class 中的 constructor 不可省略 B. constructor 必须与 class 同名,但方法不能与 class 同名 C. constructor 在一个对象被 new 时执行 class 只能定义一个 constructor 答案: C详解: 见下面代码, 很明显方法是可以和类名同名的,和构造方法唯一的区别就是,构造方法没有返回值。.study; public class TestConStructor { public TestConStructor() { ("constructor"); } public void TestConStructor() { ("not constructor"); } public static void main(String[] args) { TestConStructor testConStructor = new TestConStructor(); ("main"); (); }} Java 存取数据库能力的包是() A. B. C. D. 答案: () A. && B. <> C. ifD. := 答案: A详解: java 中没有<> :=这种运算符, if else 不算运算符 a=0;c=0; do{ --c; a=a-1; }while(a>0); 后, C的值是() . -: C详解: Do while 中的语句是至少要执行一次的。执行顺序为: do 中的语句,然后价差 while 条件,如果为 false , 则终止;如果为 true ,则继续执行 Do 中的语句,然后再检查 while 条件,如此循环。 () A. abstract 修饰符可修饰字段、方法和类 body 部分必须用一对大括号{}包住 ,大括号可有可无 : D详解: abstract 不能修饰字段。既然是抽象方法,当然是没有实现的方法,根本就没有 body 部分。 () local variable ,真正被传递的参数 : A 详解: 形参可以看成方法中的局部变量。传递的是对象引用 ()