A 、编写源代码 B 、编写HTML 文件调用该小程序,以.html 为扩展名存入相同文件夹 C 、编译过程 D 、解释执行 85 .Java的字符类型采用的是Unicode 编码方案,每个Unicode 码占用____个比特位。(B ) A 、8 B 、16 C 、32 D 、64 86 .关于下列程序段的输出结果,说法正确的是:( D ) 基本类型数值数据的默认初始值为0 public class MyClass{ static inti; public static void main(String argv[]){ System.out.println(i); } } A 、有错误,变量i 没有初始化。 B 、null C 、1 D 、0 87 .下列代码的执行结果是:( B) public class Test3{ public static void main(String args[]){ System.out.print(100%3); System.out.print(","); System.out.println(100%3.0); } } A 、1,1 B 、1,1.0 C 、1.0,1 D 、1.0,1.0 88 .下列程序段的输出结果是:(B ) void complicatedExpression(){ int x=20, y=30; boolean b; b=x>50&&y>60||x>50&&y<-60||x<-50&&y>60||x<-50&&y<-60; System.out.println(b); } A 、true B 、false C 、1 D 、0 89 .给出下列代码片段:( ) if(x>0){System.out.println("first");} else if(x>-3){ System.out.println("second");} else {System.out.println("third");} 请问x 处于什么范围时将打印字符串“second ”? A 、x>0 B 、x>-3 C 、x<=-3 D 、x<=0 &&x>-3 90 .若要把变量声名为暂时性变量,应使用如下哪种修饰符?(C ) A 、protected B 、provate C 、transient (临时变量) D 、volatile (共享变量) 91 .在Java 中,一个类可同时定义许多同名的方法,这些方法的形式参数的个数、类型 或顺序各不相同,传回的值也可以不相同,这种面向对象程序特性称为:( ) A 、隐藏 B 、覆盖 C 、重载 D 、Java 不支持此特性 92 .如要抛出异常,应用下列哪种子句?( ) A 、catch B 、throws C 、try 4 / 5
D 、finally 93 .在使用interface 声明一个接口时,只可以使用____修饰符修饰该接口。( ) A 、private B 、protected C 、private protected D 、public 94 .下列代码的输出结果是: ( ) class Parent{ void printMe() { System.out.println("parent"); } }; class Child extends Parent { void printMe() { System.out.println("child"); } void printall() { super.printMe(); this.printMe(); printMe(); } } public class Test_this { public static void main(String args[]) { Child myC=new Child(); myC.printall(); } } A 、parent child child B 、parent child parent C 、parent child D 、编译错误 95 .为读取的内容进行处理后再输出,需要使用下列哪种流? ( ) A 、File stream B 、Pipe stream C 、Random stream D 、Filter stream 96. 为实现多线程之间的通信,需要使用下列哪种流才合适?( ) A 、Filter stream B 、File stream C 、Random access stream D 、P iped stream 97 .Swing与aWT 的区别不包括:( ) A 、Swing 是由纯Java 实现的轻量级构件 B 、Swing 没有本地代码 C 、Swing 不依赖操作系统的支持 D 、Swing 支持图形用户界面 98 .在编写Java applet程序时,若需要对发生事件作出响应和处理,一般需要在程序的 开头写上____语句。 ( ) A 、import java.awt.*; B 、import java.applet.*; C 、import java.io.*; D 、import java.awt.event.*; 99 .注释的基本原则不包括:( ) A 、注释应该增加代码的清晰度 B 、注释要简洁 C 、在写代码之前写注释 D 、尽量给每一条语句加注释 100 .java.io包中定义了多个流类型来实现输入和输出功能,可以从不同的角度对其进行分类, 按功能分为:( ) A 、输入流和输出流(方向) B 、字节流和字符流(内容) |
|