文档库 最新最全的文档下载
当前位置:文档库 › Java期末考试习题库(选择题+填空题+改错题学生)

Java期末考试习题库(选择题+填空题+改错题学生)

Java期末考试习题库(选择题+填空题+改错题学生)
Java期末考试习题库(选择题+填空题+改错题学生)

一、选择题

1、下面关于变量及其作用范围的陈述哪个是不对的?(B )

A.实例变量是类的成员变量。

B.实例变量用关键字static声明。

C.在方法中定义的局部变量在该方法被执行时创建。

D.局部变量在使用前必须被初始化。

2、下面哪条语句把方法声明为抽象的公共方法?(B )

A.public abstract method();

B.public abstract void method();

C.public abstract void method(){}

D.public void method() extends abstract;

3、哪个是将一个十六进制值赋值给一个long型变量?(D )

A.long number = 345L;

B.long number = 0345;

C.long number = 0345L;

D.long number = 0x345L;

4、下面的哪个赋值语句是不对的?(A )

A.float f = 11.1;

B.double d = 5.3E12;

C.double d = 3.14159;

D.double d = 3.14D;

5、下面哪个是不合法的标识符?(C )

A.$persons;

B.TwoUsers;

C.*point;

D._endline;

6、若在某一个类定义中定义有如下的方法:final void aFinalFunction( );

则该方法属于( C )。

A、本地方法

B、静态方法

C、最终方法

D、抽象方法

7、main方法是Java Application程序执行的入口点,关于main方法的方法头以下哪项是合

法的( B )。

A、public static void main()

B、public static void main(String[ ] args)

C、public static int main(String[ ] args)

D、public void main(String arg[ ])

8、在Java中,一个类可同时定义许多同名的方法,这些方法的形式参数个数、类型或顺序

各不相同,传回的值也可以不相同。这种面向对象程序的特性称为( C )。

A、隐藏

B、覆盖

C、重载

D、Java不支持此特性

10、以下代码段执行后的输出结果为( C )。

int x=-3; float y=10.0f;

System.out.println(y%x);

A、不能成功编译

B、-1.0

C、1.0

D、-1

11、下列关于构造方法的叙述中,错误的是( C )

A.Java语言规定构造方法名与类名必须相同

B.Java语言规定构造方法没有返回值,但不用void声明

C.Java语言规定构造方法不可以重载

D.Java语言规定构造方法只能通过new自动调用

12、关于被私有访问控制符private修饰的成员变量,以下说法正确的是(C )

A.可以被三种类所引用:该类自身、与它在同一个包中的其他类、在其他包中的该类的子类

B.可以被两种类访问和引用:该类本身、该类的所有子类

C.只能被该类自身所访问和修改

D.只能被同一个包中的类访问

13、执行完以下代码int [ ] x = new int[10];后,以下哪项说明是正确的( A )

A.x[9]为0

B.x[9]未定义

C.x[10]为0

D.x[0]为空

14、类Test1定义如下:

1. public class Test1{

2.public float aMethod(float a, float b){ }

3.

4.}

将以下哪种方法插入行3是不合法的。( B )

A、public float aMethod(float a,float b,float c){ }

B、public float aMethod(float c,float d){ }

C、public int aMethod(int a,int b){ }

D、private float aMethod(int a,int b,int c){ }

15、阅读以下代码:

public class foo{

public static void main (String[] args){

String s;

System.out.println("s=" + s);

}

}

输出结果应该是:( C )

A.代码得到编译,并输出“s=”

B.代码得到编译,并输出“s=null”

C.由于String s没有初始化,代码不能编译通过

D.代码得到编译,但捕获到NullPointException异常

16、下述概念中不属于面向对象方法的是( D )。

A.对象、消息 B.继承、多态

C.类、封装 D.过程调用

17、编译并运行以下程序,以下描述哪个选项是正确的( A )。

1. class A{

2. protected String toString(){

3. return super.toString();}

4. }

A、行2出错,不能成功编译

B、编译通过但运行时出错

C、编译通过运行无异常

D、不能成功编译,行3出错

18、假设Foo类有如下定义,设f是Foo类的一个实例,下列语句调用哪个

是错误的?( A )

public class Foo

{ int i;

static String s;

void imethod() { }

static void smethod() { }

}

A、Foo.imethod();

B、f.imethod();

C、System.out.println(f.i);

D、Foo.smethod()

19、以下哪个接口的定义是正确的?( D )

A、interface A

{ void print() { } ;}

B、abstract interface A

{ void print() ;}

C、abstract interface A extends I1, I2 // I1、I2为已定义的接口

{ abstract void print(){ };}

D、interface A

{ void print();}

20、关于以下程序段,正确的说法是( C )

1. String s1=“a”+“b”;

2. String s2=new String(s1);

3.if(s1==s2)

4.System.out.println(“= =is succeeded”);

5. if (s1.equals(s2))

6.System.out.println(“.equals() is succeeded”);

A.行4与行6都将执行 B.行4执行,行6不执行C.行6执行,行4不执行 D.行4、行6都不执行21、下列哪些标识符是不合法的?( B )

A: _underscore

B: 5Intel

C: Intel5

D: $value$

22、对数组的定义及初始化不正确的方法是:( B )

A.int array[]; B.int array[8];

C.int[] array=new int[8]; D.int array[]=new int[8];

23、下面哪个表达式正确?( D )

A.float f=1.3; B.char c="a"; C.byte b=257; D.int i=10;

24、下面程序运行结果为:(D,如果输出count则为A)

public class test3

{public static void main(String args[])

{ int count=0;

for (int i=0;i<=100;i++)

count+=count++;

}

}

A 0

B 7 c 编译有错误 D 其他答案

25、下面哪个函数是public void aMethod(){...}的重载函数?(D)

A、void aMethod( ){...}

B、public int aMethod(){...}

C、public void aMethod ( ){...}

D、public int aMethod ( int m){...}

26、下面关于继承的哪些叙述是正确的? ( D )

A.在java中允许多继承。

B.在java中一个类只能实现一个接口。

C.在java中一个类不能同时继承一个类和实现一个接口。

D. java的单一继承使代码更可靠。

27、关于length()这个方法的表述正确的是哪个? ( C )

A.数组有length()这个方法,string也有length()这个方法。

B.数组有length()有这个方法,string没有length()这个方法。

C.数组没有length()这个方法,string有length()这个方法。

D.数组没有length()这个方法,string也没有length()这个方法。

28、运行下面程序段的结果是:( C )。

public class MyMain{

public static void main(String args){

System.out.println(“Hello Java”);

}

}

A.正常输出Hello Java

B.编译时出错

C.运行时出错

D. 以上答案都不对

29、选择排序的思想是,将数据序列划分为两个子列,一个子列是排好序的,另一个是尚未排序的。现若想将数据序列由小到大排序,则每次放到有序子列尾部位置的元素,应从无序序列中选择(A )。

A)最大的B)最小的C)任意的D)头上的

30、关于以下程序段,正确的说法是( C )。

1. String s1=“x”+“y”;

2. String s2=new String(s1);

3.if(s1==s2)

4.System.out.println(“= =is succeeded”);

5. if (s1.equals(s2))

6.System.out.println(“.equals() is succeeded”);

A.行4与行6都将执行 B.行4执行,行6不执行

C.行6执行,行4不执行 D.行4、行6都不执行

31、类与对象的关系是( A )。

A. 类是对象的抽象

B. 类是对象的具体实例

C. 对象是类的抽象

D. 对象是类的子类

32、下列关于修饰符混用的说法,错误的是( D )

A. abstract不能与final并列修饰同一个类

B. abstract类中不可以有private的成员

C. abstract方法必须在abstract类中

D. static方法中能处理非static的属性

33、编译并运行下述程序段的结果是:( B )。

public class Test{

public static void main(String argv[]){

int[] count = new int[4];

System.out.println(count[4]);

}

}

A.编译时错误

B.运行时错误

C.输出0

D.输出null

34、下面是有关子类继承父类构造函数的描述,其中正确的是( B )。

A.创建子类的对象时, 先调用子类自己的构造函数,然后调用父类的构造函数。

B.子类无条件地继承父类不含参数的构造函数。

C.子类必须通过super关键字调用父类的构造函数。

D.子类无法继承父类的构造函数。

35、下列类的定义中,错误的是( C )。

A.class x { .... }

B.public x extends y { .... }

C.public class x extends y { .... }

D.class x extends y implements y1 { .... }

36、假设A类有如下定义,设a是A类的一个实例,下列语句调用哪个是错误的?( C )class A

{ int i;

static String s;

void method1() { }

static void method2() { }

}

A、System.out.println(a.i);

B、a.method1();

C、A.method1();

D、A.method2()

38、假设A类有如下定义,设a是A类的一个实例,下列语句调用哪个是错误的?(C )class A

{ int i;

static String s;

void method1() { }

static void method2() { }

}

A、System.out.println(a.i);

B、a.method1();

C、A.method1();

D、A.method2()

39、A派生出子类B ,B派生出子类C,并且在Java源代码中有如下声明:

1. A a0=new A();

2. A a1 =new B();

3. A a2=new C();

问以下哪个说法是正确的?( D )

A、只有第1行能通过编译

B、第1、2行能通过编译,但第3行编译出错

C、第1、2、3行能通过编译,但第2、3行运行时出错

D、第1行、第2行和第3行的声明都是正确的

40、以下哪个接口的定义是正确的?(D)

A、interface B

{ void print() { } ;}

B、abstract interface B

{ void print() ;}

C、abstract interface B extends A1,A2 //A1、A2为已定义的接口

{ abstract void print(){ };}

D、interface B

{ void print();}

41、下面的哪个赋值语句是正确的?( D )

A、short myshort=99s;

B、String name=?Excellent?;

C、char c=17c;

D、int z=015;

42、下面哪个不是Java的保留字或关键字?( B )

A、d efault

B、NULL

C、throws

D、l ong

43、下面哪个是Math类中正确的方法?( A )

A、random()

B、Random()

C、square()

D、sqr()

44、编译并运行以下程序段的结果是:()

public static void main(String args[ ]){

Frame f=new Frame (“Visual”);

f.setSize(300,300);

f.setVisible(true);

Point p=f.getLocation();

System.out.println(“x is ”+ p.x);

System.out.println(“y is ”+ p.y);

}

A、x is 300

y is 300

B、x is 0

y is 0

C、x is 0

y is 300

D、x is 300

y is 0

45、下面哪个不是Thread类的方法?( C )

A、yield()

B、sleep(long msec)

C、go()

D、stop()

46、下面哪个不是Collection接口的方法?( D )

A、iterator

B、isEmpty

C、toArray

D、setText

47、下面哪个不是String类的方法?( C )

A、subString()

B、startsWith()

C、toString()

D、toUpperCase()

48、编译并运行以下程序段的结果是:( A i是final )

public class MyClass{

final static int i;

MyClass(){i =0;}

public static void main(String args[]){

System.out.println(i);

}

}

A、编译出错

B、null

C、1

D、0

49、下面哪条语句是正确的?( D )

A: short snum = 99s;

B: String name = …Class Name is: 03076?;

C: char c = 17c;

D: float f = 3.4f;

50、下面哪个语句(初始化数组)是不正确的:( B )

A: int x[] = {1,2,3};

B: int x[3] = {1,2,3};

C: int[] x = {1,2,3};

D: int x[] = new int[]{1,2,3};

51、下面方法中的“返回类型Type”应该是什么? ( D )

public class ReturnIt{

returnType methodA(byte x, double y){

return (short)x / y * 2;

}

}

A.double

B. int

C. byte

D. short

52、下面哪一个表达式是正确的? ( C )

A、 byte=128;

B、 Boolean=null;

C、 long l=0xfffL;

D、 double=0.9239d;

53、下面哪个修饰符修饰的变量是所有同一个类生成的对象共享的?( C )

A、public

B、private

C、static

D、final

54、下面关于java中类的说法哪个是不正确的?( C )

A、类体中只能有变量定义和成员方法的定义,不能有其他语句。

B、构造函数是类中的特殊方法。

C、类一定要声明为public的,才可以执行。

D、一个java文件中可以有多个class定义。

55、下列哪个类声明是正确的? ( D )

A、 abstract final class H1{…}

B、 abstract private move(){…}

C、 protected private number;

D、 public abstract class Car{…}

56、方法重载是指 (A )

A.两个或两个以上的方法取相同的方法名,但形参的个数或类型不同

B.两个以上的方法取相同的名字和具有相同的参数个数,但形参的类型可以不同

C.两个以上的方法名字不同,但形参的个数或类型相同

D.两个以上的方法取相同的方法名,并且方法的返回类型相同

59、哪个布局管理器使用的是组件的最佳尺寸? ( A )

A. FlowLayout

B. BorderLayout

C. GridLayout

D. CardLayout

60、Frame的默认的布局管理器是下列哪一个? ( B )

A.FlowLayout

B.BorderLayout

C.GridLayout

D.CardLayout

61、下列哪个用户图形界面组件在软件安装程序中是常见的? ( B )

A.滑块

B.进度条

C.对话框

D.标签

62、包含可单击按钮的类的Java类库是哪个? C

A.AWT

B.Swing

C.二者都有

D.二者都没有

63、下面的哪个用户界面组件不是容器? ( D )

A. JScrollPane

B. JFrame

C. JWindows

D. JScrollBar

64、在下列事件处理机制中哪个不是机制中的角色? ( C )

A. 事件

B. 事件源

C. 事件接口

D. 事件处理者

65.欲构造ArrayList类的一个实例,此类继承了List接口,下列哪个方法是正确的 ( B )

A、 ArrayList myList=new Object();

B、 List myList=new ArrayList();

C、 ArrayList myList=new List();

D、 List myList=new List();

67.指出正确的表达式 ( C )

A、 byte=128;

B、 Boolean=null;

C、 long l=0xfffL;

D、 double=0.9239d;

68.指出下列程序运行的结果 ( B )

public class Example{

String str=new String("good");

char[]ch={'a','b','c'};

public static void main(String args[]){

Example ex=new Example();

ex.change(ex.str,ex.ch);

System.out.print(ex.str+" and ");

Sytem.out.print(ex.ch);

}

public void change(String str,char ch[]){

str="test ok";

ch[0]='g';

}

}

A、 good and abc

B、 good and gbc

C、test ok and abc

D、 test ok and gbc

69.运行下列程序, 会产生什么结果 ( A 应该是runnable )

public class X extends Thread implements Runable{

public void run(){

System.out.println("this is run()");

}

public static void main(String args[])

{

Thread t=new Thread(new X());

t.start();

}

}

A、第一行会产生编译错误

B、第六行会产生编译错误

C、第六行会产生运行错误

D、程序会运行和启动

71.容器被重新设置大小后,哪种布局管理器的容器中的组件大小不随容器大小的变化而改变? ( B )

A、 CardLayout

B、 FlowLayout

C、 BorderLayout

D、 GridLayout

72.给出下面代码:

public class Person{

static int arr[] = new int[10];

public static void main(String a[])

{

System.out.println(arr[1]);

}

}

那个语句是正确的? ( C )

A、编译时将产生错误;

B、编译时正确,运行时将产生错误;

C 、输出零;

D、输出空。

74.下列哪些语句关于内存回收的说明是正确的? ( D )

A、程序员必须创建一个线程来释放内存;

B、内存回收程序负责释放无用内存

C、内存回收程序允许程序员直接释放内存

D、内存回收程序可以在指定的时间释放内存对象

75.下列代码哪几行会出错: ( C )

1) public void modify() {

2) int I, j, k;

3) I = 100;

4) while ( I > 0 ) {

5) j = I * 2;

6) System.out.println (" The value of j is " + j );

7) k = k + 1;

8) I--;

9) }

10} }

A、 line 4

B、 line 6

C、 line 7

D、 line 8

76.MAX_LENGTH是int型public成员变量, 变量值保持为常量100,用简短语句定义这个变量。 ( D )

A、 public int MAX_LENGTH=100;

B、 final int MAX_LENGTH=100;

C、 final public int MAX_LENGTH=100;

D、 public final int MAX_LENGTH=100.

77.给出下面代码:

1) class Parent {

2} private String name;

3} public Parent(){}

4} }

5) public class Child extends Parent {

6} private String department;

7} public Child() {}

8} public String getValue(){ return name; }

9} public static void main(String arg[]) {

10} Parent p = new Parent();

11} }

12} }

那些行将引起错误? ( D )

A、第3行

B、第6行

C、第7行

D、第8行

78.类Teacher和Student是类Person的子类;

Person p;

Teacher t;

Student s;

//p, t and s are all non-null.

if(t instanceof Person) { s = (Student)t; } 最后一句语句的结果是: ( D )

A、将构造一个Student对象;

B、表达式是合法的;

C、表达式是错误的;

D、编译时正确,但运行时错误。

79.给出下面代码段

1) public class Test {

2} int m, n;

3} public Test() {}

4} public Test(int a) { m=a; }

5} public static void main(String arg[]) {

6} Test t1,t2;

7} int j,k;

8} j=0; k=0;

9} t1=new Test();

10} t2=new Test(j,k);

11} }

12} }

哪行将引起一个编译时错误?( D )

A、 line 3

B、 line 5

C、 line 6

D、 line 10

80.对于下列代码:

1) class Person {

2} public void printValue(int i, int j) {//... } 3} public void printValue(int i){//... }

4} }

5) public class Teacher extends Person {

6} public void printValue() {//... }

7} public void printValue(int i) {//...}

8} public static void main(String args[]){

9} Person t = new Teacher();

10} t.printValue(10);

11} }

第10行语句将调用哪行语句? ( D )

A、 line 2

B、 line 3

C、 line 6

D、 line 7

81.哪个关键字可以抛出异常? ( C )

A、 transient

B、 finally

C、 throw

D、 static

82.Main()方法的返回类型是: ( B )

A、 int

B、 void

C、 boolean

D、 static

83.System类在哪个包中? ( D )

A、 java.util

B、 java.io

C、 java.awt

D、 https://www.wendangku.net/doc/6715052158.html,ng

84.对于下列代码:

public class Parent {

public int addValue( int a, int b) {

int s;

s = a+b;

return s;

}

}

class Child extends Parent {

}

下述哪些方法可以加入类Child? ( C )

A、 int addValue( int a, int b ){// do something...}

B、 public void addValue (int a, int b ){// do something...}

C、 public int addValue( int a ){// do something...}

D、 public int addValue( int a, int b )throws MyException {//do something...}

85.给出下面代码:

public class test{

static int a[] = new a[10];

public static void main(String args[]) {

System.out.println(arr[10]);

}

}

那个选项是正确的? ( C )

A、编译时将产生错误;

B、编译时正确,运行时将产生错误;

C、输出零;

D、输出空。

86.下面哪些选项是正确的main方法说明? ( B )

A、 public main(String args[])

B、 public static void main(String args[])

C、 private static void main(String args[])

D、 void main()

87.给定下面的代码片段:

1) String str = null;

2) if ((str != null) && (str.length() > 10)) {

3} System.out.println("more than 10");

4} }

5) else if ((str != null) & (str.length() < 5)) {

6} System.out.println("less than 5");

7} }

8) else { System.out.println("end"); }

哪些行会导致错误? ( C )

A、 line 1

B、 line 2

C、 line 5

D、 line 8

88.下面哪种注释方法能够支持javadoc命令: ( B )

A、 /**...**/

B、 /*...*/

C、 //

D、 /**...*/

93.看下面一段程序:

class Aclass{

void go(){

System.out.println("Aclass");

}

}

public class Bclass extends Aclass{

void go{

System.out.println("Bclass");

}

public static void main(String args[]){

Aclass a=new Aclass();

Aclass a1=new Bclass();

a.go();

a1.go();

}

以上程序运行结果是: C

A、 Aclass

Aclass

B、 Bclass

Bclass

C、 Aclass

Bclass

D、 Bclass

Aclass

94.下列关于Java线程的说法那些是正确的( D )

A、每一个Java线程可以看成由代码、一个真实的CPU以及数据三部份组成。

B、创建线程的两种方法中,从Thread类中继承的创建方式可以防止出现多父类问题。

C、 Thread类属于java.util程序包。

D、以上说法无一正确。

95.看以下程序:

boolean a=false;

boolean b=true;

boolean c=(a&&b)&&(!b);

int result=c==false?1:2;

这段程序执行完后,c与result的值是: ( A )

A、 c=false;result=1;

B、 c=true;result=2;

C、 c=true;result=1;

D、 c=false;result=2;

96.运行下列程序, 会产生什么结果 ( D )

public class X extends Thread implements Runable{

public void run(){

System.out.println("this is run()");

}

public static void main(String args[])

{

Thread t=new Thread(new X());

t.start();

}

}

A、 in the Inner outer

B、 outer

C、 in the Inner

D、编译不通过

97.指出下列程序的运行结果 ( B )

int i = 9;

switch (i) {

default:

System.out.println("default");

case 0:

System.out.println("zero");

break;

case 1:

System.out.println("one");

case 2:

System.out.println("two");

}

A、 default

B、 default, zero

C、 error default clause not defined

D、 no output displayed那个

99. 下面哪个单词是Java语言的关键字( B )

A、Float

B、this

C、string

D、unsigned

100. 下面哪个是Java语言中正确的标识符( C )

A、3com

B、import

C、that

D、this

101. 下面哪个语句不能定义一个字符变量( B )

A、char c1=06477;

B、char c2=’\uface’ ;

C、char c4=0xbeef ;

D、char c3=\u0041;

102. 下面哪个修饰符修饰的方法只能被本类中的其他方法使用( C )

A、protected

B、static

C、private

D、public

104. 下面哪个是对字符串String的正确定义( A )

A、String s1=null;

B、String s2=’null’ ;

C、String s3=(String) ‘abc’ ;

D、String s4=(String) ‘\uface’;

105. 下面哪条语句不能定义一个float型的变量( B )

A、float f1= -343 ;

B、float f2=3.14 ;

C、float f3=0x12345 ;

D、float f4=2.8F ;

106. 下面哪条语句定义了5个元素的数组( A )

A、int [] a={22,23,24,25,12};

B、int a []=new int(5);

C、int [5] array;

D、int [] arr;

108. 给出一段程序,选择运行结果

public class sss {

public static void main(String args[])

{

String s1=args[1]; String s2=args[2];

String s3=args[3]; String s4=args[4];

System.out.println(“args[2]=”+s2);

}

}

命令行执行: java sss 1 2 3 4 结果是下面哪一个?( D )

A、args[2]=2

B、args[2]=null

C、args[2]=1

D、运行出现异常

110. 给出一段程序,试判断哪个是正确的结果()

public class rtExcept{

public static void throwit(){

System.out.print(“throwit”);

throw new RuntimeException(); }

public static void main(String [] aa){

try{

System.out.print(“hello “);

throwit(); }

catch(Exception re){

System.out.print(“caught ”); }

finally{

System.out.print(“finally ”); }

System.out.print(“after ”);

}

}

A、hello throwit caught

B、hello throwit caught finally after

C、hello throwit RuntimeException after

D、hello throwit caught finally after RuntimeException

111. 对一个java源文件 aaa.java,编辑保存后但未编译,在其所在目录下执行 java aaa,则接着会出现什么( C )

A、error: cannot read: aaa.java

B、无任何显示

C、Exception in thread "main" https://www.wendangku.net/doc/6715052158.html,ng.NoClassDefFoundError: aaa

D、程序正常执行并显示

112. 编译java程序时出现error: cannot read: aaa.java,则下列原因最正确的是( C )

A、原因是执行的当前目录下没有找到aaa.java文件。

B、原因是没有安装JDK开发环境。

C、原因是java源文件名后缀一定是以 .txt 结尾。

D、原因是JDK安装后没有正确设置环境变量PATH和Classpath 。

113. 给出一段程序,试判断哪个是正确的结果( D )

public class myprogram{

public static void main (String args[]){

try{

System.out.print(“Hello world ”); }

finally{

System.out.println(“Finally executing”);

}

}

}

A、无法编译,因为没有指定异常

B、无法编译,因为没有catch子句

C、Hello world

D、Hello world Finally executing

114. 下面哪个是Java语言中正确的标识符( B )

A、3D

B、$this

C、extends

D、implements

115. 下面哪个范围是char型的取值范围()

A、-256 ~ 255

B、-(2^15) ~ (2^15)-1

C、’\u0000’ ~ ‘\uffff’

D、 0~32767

116. 下面哪个语句不能定义一个字符变量( D )

A、char c1=3210;

B、char c2=’\uface’ ;

C、char c4=0xabcd ;

D、char c3=”\u0065”;

117. 下面哪个是对字符串String的正确定义( A )

A、String s1=”\n\t null”;

B、String s2=’null’ ;

C、String s3=(String) ‘abc’ ;

D、String s4=(String) ‘\uface’;

118. 给出下面一段程序,选择运行结果( D )

public class X{

public static void main(String [] args){

String names[]=new String[5];

for(int x=0;x

System.out.println(names[2]);

}}

命令行执行: java X a b 结果是下面哪一个?

A、names

B、b

C、null

D、运行出现异常

119. 下面哪个描述是正确的( C )

A、Applet程序中不需要main()方法,也不能有

B、Application程序中可以没有main()方法。

C、Applet程序中可以不定义init( )方法

D、Application程序中必须有run( )方法

120. 下面哪项可以得到数组元素的个数,java中定义数组名为 abc,( B )A、abc.length( ) B、abc.length C、len(abc) D、ubound(abc)

121.下面哪个修饰符修饰的变量是所有同一个类生成的对象共享的( C )

A、public

B、private

C、static

D、final

122. 给出一段程序,试判断哪个是正确的结果( D )

public class myprogram{

public static void main (String args[]){

try{ System.out.print(“Hello world ”); }

finally{

System.out.println(“Finally executing”); } } }

java期末考试试题及答案

1.谈谈final, finally, finalize的区别。 final关键字: a) 如果一个类被声明为final,意味着它不能再派生出新的子类,不能作为父类被继承。因此一个类不能既被声明为abstract的,又被声明为final的。 b) 将变量或方法声明为final,可以保证它们在使用中不被改变。 c) 被声明为final的变量必须在声明时给定初值,而在以后的引用中只能读取,不可修改。 d) 被声明为final的方法也同样只能使用,不能重载。 finally关键字:在异常处理时提供finally 块来执行任何清除操作。如果抛出一个异常,那么相匹配的catch 子句就会执行,然后控制就会进入finally 块。 finalize:方法名,不是关键字。Java技术允许使用finalize() 方法在垃圾收集器将对象从内存中清除出去之前做必要的清理工作。这个方法是由垃圾收集器在确定这个对象没有被引用时对这个对象调用的。它是在Object 类中定义的,因此所有的类都继承了它。子类覆盖finalize() 方法以整理系统资源或者执行其他清理工作。finalize()方法是在垃圾收集器删除对象之前对这个对象调用的。 2.GC是什么? 为什么要有GC? GC是垃圾收集器。Java 程序员不用担心内存管理,因为垃圾收集器会自动进行管理。要请求垃圾收集,可以调用下面的方法之一: System.gc() Runtime.getRuntime().gc() 3.Math.round(11.5)等於多少? Math.round(-11.5)等於多少? 写程序Math.round(11.5) = 12 Math.round(-11.5) = -11 4.给我一个你最常见到的runtime exception ArithmeticException, ArrayStoreException, BufferOverflowException, BufferUnderflowException, CannotRedoException, CannotUndoException, ClassCastException, CMMException, ConcurrentModificationException, DOMException, EmptyStackException, IllegalArgumentException, IllegalMonitorStateException, IllegalPathStateException, IllegalStateException, ImagingOpException, IndexOutOfBoundsException, MissingResourceException, NegativeArraySizeException, NoSuchElementException, NullPointerException, ProfileDataException, ProviderException, RasterFormatException, SecurityException, SystemException, UndeclaredThrowableException, UnmodifiableSetException, UnsupportedOperationException

JAVA期末考试复习试题

JAVA期末考试复习试题 JAVA期末考试复习试题 1.使用Java语言编写的源程序保存时的文件扩展名是()。(A).class (B).java (C).cpp (D).txt 2.设int a=-2,则表达式a>>>3的值为()。(A)0 (B)3 (C)8 (D)-1 3.设有数组的定义int[] a = new int[3],则下面对数组元素的引用错误的是()。(A)a[0]; (B)a[a.length-1]; (C)a[3]; (D)int i=1; a[i]; 4.在类的定义中可以有两个同名函数,这种现象称为函数()。(A)封装(B)继承(C)覆盖(D)重载5.在类的定义中构造函数的作用是()。(A)保护成员变量(B)读取类的成员变量(C)描述类的 特征(D)初始化成员变量6.下面关键字中,哪一个不 是用于异常处理语句()。(A)try (B)break (C)catch (D)finally 7.类与对象的关系是()。 (A)类是对象的`抽象(B)对象是类的抽象(C)对象 是类的子类(D)类是对象的具体实例8.下面哪一个是Java中不合法的标识符()。(A)$persons (B)twoNum (C)_myVar (D)*point 9.为AB类的一个无形

式参数无返回值的方法method书写方法头,使得使用类名AB 作为前缀就可以调用它,该方法头的形式为( )。(A)static void method( ) (B)public void method( ) (C)final void method( ) (D)abstract void method( ) 10.欲构造ArrayList类的一个实例,此类继承了List接 口,下列哪个方法是正确的()。(A)ArrayList myList=new Object( ) (B)List myList=new ArrayList( ) (C)ArrayList myList=new List( ) (D)List myList=new List( ) 11.Java源文件和编译后的文件扩展名分别为 ()(A) .class和 .java (B).java和 .class (C).class和 .class (D) .java和 .java 12.在Java Applet程序用户自定义的Applet子类中,一般需要重载父类 的( )方法来完成一些画图操作。(A) start( ) (B) stop( ) (C) init( ) (D) paint( ) 13.对于一个Java源文件,import, class定义以及package正确的顺序是: (A) package,import,class (B) class,import,package (C) import,package,class (D) package,class,import 14.下面哪个是非法的:(A) int I = 32; (B) float f = 45.0; (C) double d = 45.0; (D) char c = ‘u’; //符号错15.Java语言使用的字符码集是(A) ASCII (B) BCD (C) DCB (D) Unicode 16. 如果一个类的成员变量只能在

高考英语各地短文改错汇编试题与解析

(全文由Peter编制) 2016年高考试题分项解析之专题----短文改错 1.【2016·全国新课标I】短文改错(10 分) My uncle is the owner of a restaurant close to that 1 live .Though not very big ,but the restaurant is popular in our area .It is always crowded with customers at meal times .Some people even had to wait outside My uncle tells me that the key to his success is honest. Every day he makes sure that fresh vegetables or high quality oil are using for cooking. My uncle says that he never dreams becoming rich in the short period of time. Instead, he hopes that our business will grow steady. 2.【2016·全国新课标II】短文改错(共10小题,每小题1分,满分10分) The summer holiday is coming. My classmates and I are talking about how to do during the holiday. We can chose between staying at home and take a trip. If we stay at home, it is comfortable but there is no need to spend money. But in that case, we will learn little about world. If we go on a trip abroad, we can broaden you view and gain knowledges we cannot get from books. Some classmates suggest we can go to places of interest nearby. I thought that it is a good idea. It does not cost many, yet we can still learn a lot. 3.【2016·全国新课标III】短文改错(共10小题;每小题1分,满分10分) The teenage year from 13 to 19 were the most difficult time for me . They were also the best and worse years in my life . At the first, I thought I knew everything and could make decisions by yourself. However, my parents didn’t seem to think such. They always tell me what to do and how to do it. At one time , I even felt my parents couldn’t understand me so I hoped I could be freely from them. I showed them I was independent by wear strange clothes. Now I am leaving home to college. At last, I will be on my own, but I still want to have my parents to turn to whenever need help.

大学java期末考试试题和标准答案

《Java程序设计基础》期终考试试卷(模拟) (闭卷) 一、简单编程题(共50分) 在考试文件夹中新建一个应用程序proj1(应用程序地文件夹名称为proj1),按照以下要求编写程序代码. 1. 在程序中定义Person类,为该类编写如下字段、构造器、访问器、修改器和相应地其他方法.(20分) (1)在Person类中定义两个字段: 私有访问权限,类型为String地name字段; 私有访问权限,类型为int地age字段. (2)在Person类中定义构造器 构造器有两个参数,第一个参数地类型是String,名字为name.第二个地类型是int,名字是age.第一个参数地值赋给字段name,第二个参数地值赋给字段age. (3)为Person类地两个字段分别编写访问器方法,方法名称分别为getName和getAge.getName方法返回类型为String地name字段地值;getAge方法返回类型为int地age字段地值. (4)为Person类地两个字段分别编写修改器方法,方法名称分别为setName和setAge.setName方法有一个String类型地参数,方法中用该参数来设置字段name地值;setAge方法有一个int类型地参数,方法中用该参数来设置字段age地值,并且保证age 字段地值不能为负数,如果要将age设置为负数则给出错误提示. (5)为Person类写一个叫做toString地方法,该方法不需要参数,有返回值.它返回一个字符串,字符串中包含name字段和age字段地值,如果name字段地值是“Helen”,age字段地值是20,则返回字符串:“Name:Helen. Age:20”. 2. 在程序中定义Student类,Student类继承Person类.(10分) (1)在Student类中除了继承其超类Person地name字段和age字段外,它还有自己地字段String类型地school,该字段地访问权限为私有. (2)Student类地构造器有三个参数,第一个参数为name,String类型;第二个参数为age,int类型;第三个参数为school,String类型,这三个参数地值分别赋给三个字段name、age和school. (3)在Student类中重写其超类Person地toString方法,要求该方法返回地字符串不仅包含超类Person中地name字段和age字段地值,而且包含子类Student中地school 字段地值.如果name字段地值是“Helen”,age字段地值是20,school字段地值是“山西大学商务学院”,则返回地字符串为“School:山西大学商务学院Name:Helen. Age:20”. 3. 在程序中定义Test类,在Test类中定义一个main方法,在main方法中实现如下操作:(10分) (1)创建一个Person类地对象,它地name为“John”,age为18,对象名为person1; (2)创建一个Student类地对象,它地name为“Helen”,age为18,school为“MIT”,对象名为stuent1; (3)分别输出这两个对象地相关信息(调用它们地toString方法). 4. 分别为Person类和Student类编写文档注释,并生成应用程序地类文档.要求如下:(10分) (1)类地文档注释,包括类名、类地作者及版本号,作者地名字用考生地姓名标注,版本号使用考试地日期; (2)构造器和各个方法地文档注释,包括方法地名称、构造器和方法地功能说明,要求标注构造器和方法中地参数及返回值,并说明参数地类型、名称和返回值地类型. (3)文档注释完成后要使用BlueJ地JavaDOC工具生成应用程序地类文档. 二、代码改错(共20分)

JAVA期末考试复习题

《J A V A程序设计》练习题 一、单选择题 1、编译Java Application 源程序文件将产生相应的字节码文件,这些字节码文件的扩展名为( B )。 A.java B. .class C.html D. .exe 2、设 x = 1 , y = 2 ,z = 3,则表达式 y+=z--/++x的值是( A )。 A. 3 B. 3.5 C. 4 D. 5 3、不允许作为类及类成员的访问控制符的是( C )。

A. public B. private C. static D. protected 4、为AB类的一个无形式参数无返回值的方法method书写方法头,使得使用类名AB作为前缀就可以调用它,该方法头的形式为(A )。 A. static void method( ) B. public void method() C. final void method( ) D. abstract void method( ) 5、关于选择结构下列哪个说法正确?( B ) A.if语句和 else语句必须成对出现 B.if语句可以没有else语句对应

C.switch结构中每个case语句中必须用break语句D.switch结构中必须有default语句 6、while循环和do…while循环的区别是:(D ) A.没有区别,这两个结构任何情况下效果一样 B.while循环比do…while循环执行效率高 C.while循环是先循环后判断,所以循环体至少被执行一次D.do…while循环是先循环后判断,所以循环体至少被执行一次 7、关于 for循环和 while循环的说法哪个正确? ( B ) A.while循环先判断后执行,for循环先执行后判断。B.while循环判断条件一般是程序结果,for循环的判断条件一般是非程序结果 C.两种循环任何时候都不可以替换

(完整版)高考英语短文改错专项练习试题.docx

高考英语短文改错专项练习试题 2015 高二级高考英语短文改错练习 【命题趋向】 短文改错是一项主要测试考生的判断能力,观察能力、纠错能力语言基础知识 及语言的综合运用能力。 短文改错的趋势: 1.改错短文以记叙文和说明文为主。 2.文章内容贴近学生生活,没有生僻词汇和复杂的结构,文章简单易懂,错误 设置也很简单,多为学生平常作文中常出现的错误。 3.短文一般 100 词左右,错误有9 处。 4.常见错有三种 : 错词、多词、缺词。错词占60%左右 【错误类型】 1.错词 2. 多词 3. 缺词 4. 正错【考 点透视】 一.错词的热点 1.动词—时态语态非谓语;主谓关系。 2.联系词—关系代词和关系副词;连词;连接词。 3.名词—可数名词、不可数名词,可数名字的单复数变化。 4.介词—介词和动词的搭配错误。 5.形容词 /副词—词类错用。 6.冠词—定冠词和不定冠词的错用。 7.代词—人称代词;物主代词;反身代词。 8.惯用法—固定句型,固定短语。 二.多词和缺词热点 1. 冠词 2.介词 3.副词 4.代词 5.关联词 6.小品词 to 【短文改错主要特点】 1.语言材料取自于学生的习作。 2.短文为贴近学生生活的话题或学生 身边事。 3.短文难度符合学生水平。 4.语言简单易懂。 5.没有生僻的语言现象或繁难的语句结构。 【例题解析】 一.错词 1.动词错误:时态和语态、主谓一致的错误。 【 1】整体时态: *Then I ask him“ Grandma, how come you have so much lines on your hand”全文为故事,故 ask 改为 asked。 *High over the water, they discover a hole in the balloon.The hole became bigger and bigger. 全篇使用过去时态,故改 discover- -discovered 【 2】主谓一致 *Having fun with their friends make them happy. 动名词短语做主语,谓语动词用单数形式makes。 *But the most wonderful thing about jack were his musical ability。 主语为 the most wonderful thing 故此,系词为 was

Java web期末考试题

第1页(共7页) 天津师范大学期末考核 2015—2016 学年第2学期 期末考核试卷 科目:Java Web 应用开发 学院:计信学院 专业:计算机科学 一、 单选题:(每小题2分,共10分) 1. 下列语句属于声明语句的是( A )。 A .<%! Int a = 4;%> B.<% int a=4;%> C .<%--int a=4-- %> D. <%@ int a=4%> 得分 2. 一个servlet 的生命周期不包括( B )方法? A .init( )方法 B. invalidate( )方法 C .service( )方法 D .destroy( )方法 得分 3. Application 对象的作用域是( B )。 A . 一次会话 B. 整个应用程序 C . 一次请求 D . 整个页面 得分 4. 下面对servlet 中重定向说法描述错误的是( D )。 A .使用的是HttpServletResponse 接口的sendRedirect()方法 B. 源组件的响应结果不会发送给客户端 C .sendRedirect()方法后的代码仍会执行 D .源组件和目标组件共享ServletRequest 对象

第2页(第7页) 得分 5. 有一个JavaBean 组件,类名为Student ,此JavaBean 组件的获得访问方法是getTotalScore,其功能是获得某个学生几门功课的总分,返回值保留一位小数,则以下关于getTotalScore 的声明正确的是( B )。 A .public int getTotalScore() B. public float getTotalScore() C .protected int getTotalScore() D .protected float getTotalScore() 得分 2. 3. Sevlet 过滤器核心对象放置在javax.servlet 包中,其名称为 4.

Java期末考试试卷1

信息学院2006—2007学年第二学期期末考试试题A 课程名称:Java 语言程序设计主讲:年级: 班级姓名学号 题号一二三四五合计 分数 一、选择(每题1分,共20分) 1.有一个名为MyClass的public类,想成功编译需满足以下哪个条件?() A. MyClass类中必须定义一个正确的main()方法。 B. MyClass必须定义在MyClass.java源文件中。 C. MyClass类必须定义在MyClass包中。 D. MyClass类必须被导入。 2.以下哪些修饰符不能用于顶层类?( ) A. public B. private C. abstract D. final 3.以下哪个是java中合法的关键字?( ) A. array B. Boolean C. protect D. super 4.以下哪些是合法的标识符?( ) A.%abcd B. 2abcd C. package D. _a_long_name 5.在Java中,一个类可同时定义许多同名的方法,这些方法的形式参数的个数、类型或顺序各不相同。这种面向对象程序的特性称为. () A、隐藏 B、覆盖 C、重载 D、Java不支持此特性 6.有以下代码,请问该程序的运行结果是什么?( ) class Example { public static void main(String args[]){ boolean b=true; System.out.println(b); } } A. 打印输出true B. 打印输出1 C.编译错误 D. 无内容输出 7.以下哪些是基本数据类型?( ) A.int B. String C. Integer D. Float 8. 给出以下代码,请选择正确的选项?( ) class Example{ public static void main(String[] args){ char a=”\u1234”; } } A. 代码编译成功 B. 代码编译成功,但有警告 C. 代码编译失败 9.以下哪个语句用于声明一个二维数组?( ) A. int[5][5] a=new int[][]; B. int a=new int[5,5] C. int[][] a=new int[5][5]; D. int[][] a=new [5]int[5]; 10.给出以下代码,请问该程序的运行结果是什么?()

java期末考试复习题及答案(1)

《Java程序设计》课程试卷 1.使用Java语言编写的源程序保存时的文件扩展名是( B )。 (A).class (B).java (C).cpp (D).txt 2.设int a=-2,则表达式a>>>3的值为( C )。 (A)0 (B)3 (C)8 (D)-1 3.设有数组的定义int[] a = new int[3],则下面对数组元素的引用错误的是( C )。 (A)a[0]; (B)a[]; (C)a[3]; (D)int i=1; a[i]; 4.在类的定义中可以有两个同名函数,这种现象称为函数( D )。 (A)封装(B)继承(C)覆盖(D)重载 5.在类的定义中构造函数的作用是( D )。 (A)保护成员变量(B)读取类的成员变量(C)描述类的特征(D)初始化成员变量 6.下面关键字中,哪一个不是用于异常处理语句( B )。 (A)try (B)break (C)catch (D)finally 7.类与对象的关系是( A )。 (A)类是对象的抽象(B)对象是类的抽象(C)对象是类的子类(D)类是对象的具体实例 8.下面哪一个是Java中不合法的标识符( D )。 (A)$persons (B)twoNum (C)_myVar (D)*point 9.为AB类的一个无形式参数无返回值的方法method书写方法头,使得使用类名AB作为前缀就可以调用它,该方法头的形式为( A )。 (A)static void method( ) (B)public void method( ) (C)final void method( ) (D)abstract void method( ) 10.欲构造ArrayList类的一个实例,此类继承了List接口,下列哪个方法是正确的( C )。 (A)ArrayList myList=new Object( ) (B)List myList=new ArrayList( ) (C)ArrayList myList=new List( ) (D)List myList=new List( ) 源文件和编译后的文件扩展名分别为( B ) (A) .class和 .java (B).java和 .class (C).class和 .class (D) .java和 .java 12.在Java Applet程序用户自定义的Applet子类中,一般需要重载父类的( D )方法来完成一些画图操作。 (A) start( ) (B) stop( ) (C) init( ) (D) paint( ) 13.对于一个Java源文件,import, class定义以及package正确的顺序是: ( A ) (A) package,import,class (B) class,import,package (C) import,package,class (D) package,class,import 14.下面哪个是非法的:( D ) (A) int I = 32; (B) float f = ; (C) double d = ; (D) char c = ‘u’;如果一个类的成员变量只能在所在类中使用,则该成员变量必须使用的修饰是( C ) (A) public (B) protected (C) private (D) static 17.下面关于main方法说明正确的是( B ) (A) public main(String args[ ]) (B) public static void main(String args[ ]) (C) private static void main(String args[ ]) (D) void main() 18.哪个关键字可以对对象加互斥锁( B ) (A) transient (B) synchronized (C) serialize (D) static 19.关于抽象方法的说法正确的是( D ) (A)可以有方法体 (B) 可以出现在非抽象类中 (C) 是没有方法体的方法(D) 抽象类中的方法都是抽象方法 包的File类是( B ) (A)字符流类(B) 字节流类 (C) 对象流类 (D) 非流类 21.Java application中的主类需包含main方法,以下哪项是main方法的正确形参( B ) A、 String args B、String args[] C、Char arg D、StringBuffer args[] 22.以下代码段执行后的输出结果为( A ) i nt x=-3; int y=-10; 、-1B、2 C、1 D、3 23.以下关于继承的叙述正确的是()。

高考英语短文改错常考考点与历年真题版

高考英语短文改错测试重点及分类解析 第一章短文改错测试重点及分类解析 根据短文改错的命题特点,我们可以按照以下四步进行备考快速练习。 第一步:审题。通读全文,了解大意。全面把握文章整体(时态、题材及容)。 第二步:重读全文,应先确定一些明显的错误,以便疏通短文,化繁为简,为后面解题打开思路。许多问题可在这一阶段得到解决。从词法、句法到行文逻辑三方面着手,逐句而不是逐行地分析、找错。 第三步:综观全篇,看错误类型的比例是否得当、前后逻辑是否一致、有无前后矛盾等现象。 第四步:认真检查,避免出现以下错误:符号不规;一个词改为几个或几个改为一个;该大写的未大写;合成词只改了其中一部分等。 下面,我们根据词性不同,来对改错题目进行分类解析。 第一节名词 在短文改错中见到名词时,应检查是否有数、格及名词前限定词用法等错误。汉语中的名词在形式上无复数变化,而是通过在名词前加数词来表示;英语则不同,除了在名词前加数词之外,如果是可数名词,还应将该名词变为复数形式。 1. 检查句中名词的单复数形式是否符合句意。 2. 检查句中有无可数名词和不可数名词的误用。 3. 检查句中有无所有格的误用。 4. 检查句中有无名词前限定词的误用。 练习 请改正下列句子中的语法错误,注意名词的使用。 1. He is on good term with me. 2. He is a generous fellow, and will soon make friend with you again. 3. His opinion is considered to be great value. 4. He sent his daughter to a girl’s high school. 5. Give me three spoonful of sugar. 6. His eyes are as blue as a Scandinavian. 7. A few peoples live to be a hundred years old. 8. Aunt Mary returned home after ten year’s absence. 9. He is a friend of my brother. 10. The observation of the law is the first duty of every citizen. 注释 1. term → terms, term的复数形式表示条件、关系, on good terms with...意为“与……关系良好”。 2. friend → friends, make friends with...与某人交朋友。 3. be great value → be of great value, val ue是名词, be of+名词=be+形容词。即of great value=greatly valuable。 4. girl’s → girls’,女子高中是a girls’ high school。 5. spoonful → spoonfuls, spoonful是可数名词。 6. scandinavian → Scandinavian’s。. 7. peoples → people此处people作“人讲”,是复数名词。 8. year’s → years’。 9. b rother → brother’s应是brother’s friends, 其后做了省略。

JAVA语言程序设计期末考试试题及答案

J A V A语言程序设计期末考试试题及答案 TTA standardization office【TTA 5AB- TTAK 08- TTA 2C】

J A V A语言程序设计考试试题及部分答案 一、单选题:(每题1分)下列各题A)、B)、C)、D)四个选项中,只有一个选项是正确的,请将正确选项的标记写在题干后的括号内。 1.下列语句序列执行后,k 的值是( B )。 int m=3, n=6, k=0; while( (m++) < ( -- n) ) ++k; A) 0 B) 1 C) 2 D) 3 2.设 i、j 为int型变量名,a 为int型数组名,以下选项中,正确的赋值语句是( B )。 A) i = i + 2 B) a[0] = 7; C) i++ - --j; D) a(0) = 66; 3.Java语言的类间的继承关系是( B )。 A) 多重的 B) 单重的 C) 线程的 D) 不能继承 4.设有定义 int i = 6 ;,则执行以下语句后,i 的值为( C )。 i += i - 1; A) 10 B) 121 C) 11 D) 100 5.下列选项中,用于在定义子类时声明父类名的关键字是( C )。 A)interface B) package C) extends D) class 6.若已定义 byte[ ] x= {11,22,33,-66} ; 其中0≤k≤3,则对x数组元素错误的引用是( C )。 A) x[5-3] B) x[k] C) x[k+5] D) x[0]

7.下列语句序列执行后,ch1 的值是( B )。 char ch1='A',ch2='W'; if(ch1 + 2 < ch2 ) ++ch1; A) 'A' B) 'B' C) 'C' D) B 8.下列语句序列执行后,i 的值是( D )。 int i=8, j=16; if( i-1 > j ) i--; else j--; A) 15 B) 16 C) 7 D) 8 9.下列语句序列执行后,k 的值是( C )。 int i=10, j=18, k=30; switch( j - i ) { case 8 : k++; case 9 : k+=2; case 10: k+=3; default : k/=j; } A) 31 B) 32 C) 2 D) 33 10.下面语句执行后,i 的值是( B )。 for( int i=0, j=1; j < 5; j+=3 ) i=i+j; A) 4 B) 5 C) 6 D) 7 11.设有定义 float x=, y=, z=;则以下的表达式中,值为true的是( B )。 A) x > y || x > z B) x != y

Java程序设计期末考试试题

Java程序设计期末考试试题、试卷、习题A卷 一、选择题。本题共20小题,每题2分,满分40 分。 1、在浏览器中执行applet 程序,以下选项中的哪个方法将被最先执行……… () A)init() B)start() C)destroy() D)stop() 2、有以下方法的定义,请选择该方法的返回类型() ReturnType method(byte x, double y) { return (short)x/y*2; } A)byte B)short C)int D)double 3、以下哪项可能包含菜单条()。 A)Panel B)Frame C)Applet D)Dialog 4、Java application中的主类需包含main方法,main方法的返回类型是什么?()A)int B)float C)double D)void 5、Java application中的主类需包含main方法,以下哪项是main方法的正确形参?( ) A)String args B)String ar[] C)Char arg D)StringBuffer args[] 6、编译Java Application 源程序文件将产生相应的字节码文件,这些字节码文件的扩展名为( )。 A). java B) .class C) . html D) .exe 7、设int型变量x = 1 , y = 2 , z = 3,则表达式y+=z--/x++ 的值是( )。 A)3 B)3. 5 C)4 D)5 8、不允许作为类及类成员的访问控制符的是( )。 A)public B)private C)static D)protected 9、为AB类的一个无形式参数无返回值的方法method书写方法头,使得使用类名AB作为前缀就可以调用它,该方法头的形式为( )。 A)static void method( ) B)public void method( ) C)final void method( ) D)abstract void method( ) 10、以下哪一个不是JAVA的标准数据流( )。 A)标准输出数据流B)标准输入数据流C)标准错误数据流D)标准运算数据流 11.设有下面两个赋值语句:( ) a = Integer.parseInt(“123”); b = Integer.valueOf(“123”).intValue(); 下述说法正确的是()。 A)、a是整数类型变量,b是整数类对象。B)、a是整数类对象,b是整数类型变量。C)、a和b都是整数类对象并且值相等。D)、a和b都是整数类型变量并且值相等。 12、下列代表十六进制整数的是( ) A)0123 B)1900 C)fa00 D)0xa2

历年高考短文改错真题汇总

历年高考短文改错真题汇总 Today I tried cooking a simply dish myself. I like eating frying tomatoes with eggs, and I thought it must to be easy to cook. My mom told me how to preparing it. First I cut the tomatoes into pieces but put them aside. Next I broke the eggs into a bowl and beat them quickly with chopstick. After that I poured oil into a pan and turned off the stove. I waited patiently unless the oil was hot. Then I put the tomatoes and the beaten eggs into pan together. “Not that way, ”my mom tried to stop us but failed. She was right. It didn't turn out as I had wished.(2020全国1) Thank you for your letter, what really made me happy. I’m glad to know that you’ve come China to learn kung fu in a school in my hometown. I’m surely you’ll have a good time. Actually, I start to learn kung fu when I was seven years old, for I have long been out of practice. Luckily, I will go home in two weeks for summer vacations. Then I can spare some time to learn it again, such that we can practice together on every day. Best of luck with yours learning kung fu in China. See you sooner.(2020全国2) My mom is really concerning with the health of everyone in our families. In order to make surely all of us are in good health, and she makes specific plans for us. For example, every morning, my dad has to have the bowl of egg soup while I had to eat an apple. My dad don't like the soup and I don't enjoy apples. I tell my mom that if we're forced eat things, we may become ill. But he insists on us eating healthy food. Understanding her good intentions, I eat all the food what is provided by Mom with appreciation.(2020全国3) I became interesting in playing football thanks to a small accident. One afternoon where I was in primary school, I was walking by the school playground. Suddenly football feel just in front of me but almost hit me. I stopped the ball and kicked it hardly back to the playground. To everyone`s surprising, the ball went into the net. All the football player on the playground cheered loudly, say that I had a talent for football. From now on, I started to play my football with classmates after school. I am a good player now. (2019全国1) Since I was a kid, I`ve considered different job I would like to do. First, I wanted to be a fireman, whose uniform looked so coolly. Then, when I was in the five grade, I wanted to be a teacher because I liked my English teacher too much. When I studied chemistry high school, I reconsidered mg goal or decided to be a doctor. They were two reasons for the decision. One was that I was amazing at the fact that a sick person could feel much more better after seeing a doctor. And the other is that I wanted to help people in need.(2019全国2) I've had many dreams since I was a child. Now my dream is to opens a cafe. Though it may appear simple, it required

相关文档
相关文档 最新文档