java考试试卷模拟试卷

java考试试卷模拟试卷
java考试试卷模拟试卷

华东交通大学软件学院03~04第二学期Java试卷

班级姓名学号

一、选择題(40分)

1、在Java中,哪个修饰符定义的变量可通过类名来访问。

A. public

B. static

C.protected

D.private 2.在浏览器中执行applet 程序,哪个方法最先执行( )。

A. paint ()

B. start()

C. init()

D. repaint()

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

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

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

C.abstract方法必须在abstract类中

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

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

int x=3; int y=10; System.out.println(y%x);

A. 0

B. 1

C. 2

D. 3

5、Java中,()类是所有类的最终祖先?

A. String

B. Nuber

C. Lang

D. Object

6、以下标识符中哪项是不合法的( )

A. Great

B. many

C. int

D. _x1

7、 Java语言中,长整数占用的存储字节数是( )。

A. 4

B. 8

C. 16

D.2

8、设有下面两个赋值语句:

a = Integer.parseInt(“1024”);

就是将String字符类型数据转换为Integer整型数据,args[0]就是输入参数中的第一个参数字符串。

b = Integer.valueOf(“1024”) ;

(2)valueOf方法将传入的参数String转化为int型值

下述说法正确的是()。

A.a是整数类型变量,b是整数类对象。

B.a是整数类对象,b是整数类型变量。

C.a和b都是整数类对象并且它们的值相等。

D.a和b都是整数类型变量并且它们的值相等。

9、若在某一个类定义中定义有如下的方法:abstract void performDial( ); 该方法属于( )。

A. 本地方法

B. 最终方法

C. 静态方法

D. 抽象方法

10、下面哪个包是用于创建图形用户界面的( )。

A. java.applet

B. java.awt

C. https://www.360docs.net/doc/075263528.html,ng

D. java.util

11、通过哪个方法可以改变按钮的颜色

A. setColor B. setBackground

C. getBackground E. setForeground

12、编译和解析执行一个java应用程序应分别采用的命令是()

A. Java和Javac

B. Javac和Java

C. Javap和Java

D. Javac和Jdb

13、以下程序段:

switch(m) {

case 0: System.out.println("case 0");

case 1: System.out.println("case 1"); break;

case 2:

default: System.out.println("default"); }

m为何值时程序的输出是“default”?

A. 0

B. 1

C. 2

D. 3

14. 定义一个1维整型数组,正确的是:

(A) int a[]= new int [10];

(B) int a[10] = new int [];

(C) int a[10] = new int [10];

(D) int []a = new int [10];

15. 用8进制表达8的值以下哪个正确?

(A) 010 (B)0x10 (C)08 (D)0x8

16. 给出以下程序段:

boolean m = true;

if ( m )

System.out.println("False");

else

System.out.println("True");

则运行结果为:

(A) False (B) True (C) None (D) 运行时出错.

17. 下列哪条指令可用于创建具有10行20列的文本域:

(A)new TextArea(10,20)

(B)new TextArea(20,10)

(C)new TextArea(new Rows(10), new Colums(20)

(D)new TextArea(200)

18. 以下程序段执行时输入:java test

则输出结果为.

class test

{

public static void main(String args[])

{

System.out.println(args[0]);

}

}

(A) 无任何输出.

(B) 产生数组访问越界例外

(C) 输出0

(D) 输出test

19. 新创建的 Frame是不可见的,使用哪个方法可使其可见。

(A) setSize(300,200) (B) setVisible(true)

(C) dispose() (D) repaint()

20. 以下哪个方法用来从字符串中获取一个字符。

(A)indexOf(String str)

(B)substring(int beginIndex, int endIndex)

(C)concat(String str)

(D)charAt(int index)

二、是非题(10分)

1. Java 应用程序可以在浏览器中执行 1

2. 要改变一个字符串的内容可以使用StringBuffer类 1

3.多线程程序必须编写run()方法。 1

4.Socket通信中服务方要创建Socket对象并监听客户连接。1

5.Java程序中可使用throws语句明确抛出例外对象。1

6.Vector对象中可以存储不同类型的对象。 1

7.ItemListener接口定义了itemStateChanged方法。实现该接口的类就要编写该方法的具体实现代码。

8.子类中要访问父类中与子类有相同方法头的方法可使用this来特指。

9. Java Application源程序的主类是指包含有main方法的类。

10.一个Java类只能继承一个父类,但可以实现多个接口。

三、分析下面各程序,写出程序的运行结果。(20分)

(1) public class Ex1{

static int m=2;

public static void main(String args[])

{

Ex1 obj1=new Ex1();

Ex1 obj2=new Ex1();

obj1.m=m+1;

System.out.println(“m=”+obj2.m);

}

}

(2)public class Ex2{

public static void main(String[] args) {

int n0 = 1, n1 = 1, n2;

for(int i = 0; i <4; i++) {

n2 = n1 + n0;

System.out.print(n2 + " ");

n0 = n1;

n1 = n2;

}

System.out.println();

}

}

(3) public class Ex3

{

String name;

int age;

public Ex3(String name,int age)

{

https://www.360docs.net/doc/075263528.html,=name;

this.age=age;

}

void incAge()

{

age=age+1;

}

public static void main(String a[])

{

student x1=new Ex3("张三",20);

student x2=new Ex3("李四",22);

x2.incAge();

System.out.println("name="+https://www.360docs.net/doc/075263528.html,+",age="+x1.age); System.out.println("name="+https://www.360docs.net/doc/075263528.html,+",age="+x2.age); }

}

(4)class Ex4{

public static void main(String args[]){

int[] a={1,2,3};

for (int i=1;i<3;i++) a[i]=a[i-1]+1;

for(int i=0;i<3;i++) System.out.print(a[i]+ " "); }

}

(5)public class Ex5 {

public static void main(String[] args) {

String s = "hello world";

int len = s.length();

StringBuffer rev = new StringBuffer(len);

for (int i = (len - 1); i >= 0; i--) {

rev.append(s.charAt(i));

}

System.out.println(rev.toString());

}

}

四、编程题(30分)

(1)编写一个图形界面程序,实现人民币与欧元的换算,在两个文本框中分别输入人民币数量和汇率,点击“转换”按钮在结果标签中显示欧元值。

(2)编写Java Application,产生100个随机整数给一维数组赋值,输出该数组,每行输出5个元素,然后将其中的素数找出来输出。

(3)编写Applet程序,从Applet参数中获取一个参数转化为整数n,在Applet 中用paint方法显示n的阶乘结果。

2002-2003学年第二学期《Java语言》考试卷

班级学号姓名分数

PART A (70 * 1 = 70 Marks) (Note: Choose the best answer. Write only the answer.)

1. 1. In Java, when a program is compiled, it is converted into ______

a) Machine code b) Byte code

c) Hexadecimal code d) None of the above.

2. 2. The ______ is the mechanism that binds the data and functions together

with each

other and keeps both safe from outside interference.

a) Encapsulation b) Polymorphism c) Inheritance d) None

3. 3. Java programs should be saved with the extension

a) .c b) .txt c) .java d) .doc

4. 4. ______ do not cause the computer to perform any action when the

program is run.

a) Comments b) the keyword Class c) Main method d) None

5. 5. When ________ appears in a string of characters, Java combines the

next

character and forms the escape sequence.

a) front slash ( / ) b) back slash ( \ ) c) comments

d) None

6. 6. Java’s numerous predefined classes are grouped into categories or

related classes

called ______

a) Objects b) Classes c) Library d) Packages

7.7. The name of the package with “java” is called

a) Core packages b) Extension package c) Both a & b

d) None

8.8. The _______ class provides prepackaged dialog boxes that enables us

to display

boxes.

a) JApplet b) Graphics c) Container d) JoptionPane

9.9. The ________ statement is used to include all the necessary classes

into our

program from the specified package.

a) class definition b) import c) main definition d) None

1 10 ._______ is the method which is used to read the value from the user

which comes

under the class JoptionPane.

a) showMessageDialog( ) b) showInputDialog( )

c) System.out d) System.in

1 11.The method which is used to convert the String value to Integer value

a) parseDouble b) parseInt c)parseFloat d)none

12. What will be printed out if you attempt to compile and run the following

code ?

int i=1;

switch (i)

{

case 0:

System.out.println("zero");

break;

case 1:

System.out.println("one");

case 2:

System.out.println("two");

default:

System.out.println("default");

}

1) one

2) one, default

3) one, two, default

4) default

13. 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");

}

1) default

2) default, zero

3) error default clause not defined

4) no output displayed

14. Which correctly create a two dimensional array of integers?

(a)int a[][] = new int [10,10];

(b)int a[10][10] = new int [][];

(c) int a[][] = new int [10][10];

(d) int []a[] = new int [10][10];

15. We have the following code:

if (a >4)

System.out.println("test1");

else if (a >9)

System.out.println("test2");

else

System.out.println("test3");

What will print 'test 2'?

A. less than 0

B. less than 4

C. between 4 and 9

D. greater than 9

E.None of the above

16. Which one does not extend https://www.360docs.net/doc/075263528.html,ng.Number

a)Integer

b)Boolean

c)Character

d)Long

e)Short

17. Public class Cycle

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

System.out.println(args[0]);

}

}

if we compile our program by java Cycle one two, what will be output?

a) cycle

b) one

c) two

d)none

18. Which of the following are NOT Java modifiers?

a) public

b) private

c) friend

d) transient

19. What is the result of executing the following code when the value of x is 2:

switch (x)

{

case 1:

System.out.println(1);

case 2:

case 3:

System.out.println(3);

case 4:

System.out.println(4);

}

Select the most appropriate answer.

(a) Nothing is printed out

(b) The value 3 is printed out

(c) The values 3 and 4 are printed out

(d) The values 1, 3 and 4 are printed out

20. What does the zeroth element of the string array passed to the public static void main method contain?

Select the most appropriate answer

(a) The name of the program

(b) The number of arguments

(c) The first argument if one is present

(d) none of the above

21. What will be the result of compiling the following code:

public class Test

{

static int age;

public static void main (String args [])

{

age = age + 1;

System.out.println("The age is " + age);

}

}

Select the most appropriate answer.

(a) Compiles and runs with no output

(b) Compiles and runs printing out The age is 1

(c) Compiles but generates a runtime error

(d) Does not compile

(e) Compiles but generates a compile time error

22. Which of the following return true?

Select all correct answers.

(a) "john" == "john"

(b) "john".equals("john")

(c) "john" = "john"

(d) "john".equals(new Button("john"))

(e) none of the above

23. What is the result of executing the following code, using the parameters 4 and 0:

public void divide(int a, int b)

{

try

{

int c = a / b;

} catch (Exception e)

{

System.out.print("Exception ");

} finally

{

System.out.println("Finally");

}

}

Select the most appropriate answer.

(a) Prints out: Exception Finally

(b) Prints out: Finally

(c) Prints out: Exception

(d) No output

24. Which Exception will be generated if the array size is mentioned as negative?

(a) ArrayIndexOutOfBoundsException

(b) NegativeArraySizeException

(c) NumberFormatException

(d) IOException

25. Which of the following methods are defined on the Graphics class:

Select all correct answers.

(a) drawLine(int, int, int, int)

(b) drawImage(Image, int, int, ImageObserver)

(c) setVisible(boolean);

(d) none of the above

26. Given the following code what is the effect of ‘a’ being 5:

public class Test

{

public void add(int a)

{

for (int i = 1; i < 3; i++)

{

for (int j = 1; j < 3; j++)

{

if (a == 5)

{

break;

}

System.out.println(i * j);

}

}

}

}

Select the most appropriate answer.

(a) Generate a runtime error

(b) Throw an out of bounds exception

(c) Print the values: 1, 2, 2, 4

(d) Produces no output

27. What is the result of executing the following fragment of code:

boolean flag = true;

if (flag = true)

{

System.out.println("true");

}

else

{

System.out.println("false");

}

Select the most appropriate answer.

(a) true is printed to standard out

(b) false is printed to standard out

(c) An exception is raised

(d) Nothing happens

28. What happens when the following program is compiled and executed with the arguments java test. Select the one correct answer.

class test

{

public static void main(String args[])

{

if(args.length > 0)

System.out.println(args.length);

}

}

(a) The program compiles and runs but does not print anything.

(b) The program compiles and runs and prints 0

(c) The program compiles and runs and prints 1

(d) The program compiles and runs and prints 2

(e) The program does not compile.

29.What will be the output of the program

int j = 1;

while(j<5)

{

if(j == 1)

continue;

j++;

}

a) 1 b) 2, 3, 4 c) infinite loop d) 2, 3, 4, 5

30. The ______is a quantity whose value does changes during program execution

a) Variable b) constant c) expression d) none

31. What is the output of the following fragment.

int a = 11, b = 3, c;

c = a % b;

System.out.println( c );

a) 3 b) 2 c) 4 d) none

32.What is the output of the following fragment.

int a = 2 * (5 – 1) / (2 +1 );

System.out.print( a );

a) 2 b) 1 c) 3 d) none

33.What is the output of the following fragment.

int a = 2;

System.out.println( a++);

System.out.println( a);

System.out.println(++a);

a) 3, 3, 3 b) 3, 3, 4 c) 2, 3, 4 d) 2, 3, 3

34.________ are the Java programs that can be embedded in HTML.

a) Applets b) Applications c) JDK d) none

35.________ is responsible for building Graphical User Interface

a) JApplet b) AWT c) JOptionPane d) none

36. ------------- is nested in a class definition within another class and treated

like any other method of that class.

(a) inner class (b) static class (c)final class (d) none of the above

37. ----------- Returns a new string object containing the original

string of characters followed by the characters in the argument..

(a) concat() (b) charAt() (c) endsWith( ) (d) none of the above

38. -------------- is the process of deriving a class from a super

class or a base class.

(a) Polymorphism (b) Inheritance (c) encapsulation( ) (d) none

39. The attributes and methods declared as ------------ in the base

class can be accessed within the class and any of its derived class.

(a) public (b) private (c) protected( ) (d) none of the above

40. -------------- is the creation of a method in the subclass that has the same

signature, i.e., name, number and type of arguments, as a method in the

super

class.

(a) overloading (b) overriding (c) inheritance ( ) (d) none

41. The class can be declared as ------------, if instances or subclasses are not to be

created.

(a) final (b) static (c) abstract ( ) (d) none of the above

42.-------------- is an abnormal condition, which occurs during the execution of

a program.

(a) error (b) static (c) exception (d) none of the above

43.----------- block provides code that always executes, regardless of whether an

exception occurs or not.

(a) try (b) catch (c) finally (d) none of the above

44. ----------- exception is generated On entering characters as input.

(a)NumberFormatException (b) ArrayIndexOutOfBoundsException

(c) IOException (d) none of the above

45. -------- contain a set of classes in order to ensure that class names are unique.

(a)Packages (b) programs (c) subclasses (d) none of the above

46. ---------- tag is used to pass parameters in an applet.

(a)Parameters (b) PARAM (c) VALUE (d) none of the above

47. Initialization of all variables, creation of objects, setting of parameters, etc.

can be done in the ---------- method.

(a)Init (b) start (c) stop (d) none of the above

48. --------------- method loads an image from an URL which specifies the

location from which the image is to be loaded.

(a)loadImage (b) getImage (c) drawImage (d) none of the above

49. In a ------------- system, only one part of the program is in the process of

execution at any one time.

(a) single - threaded (b) multi-threaded (c) double-threaded (d) none

50. A ----------- is an object that implements a specific EventListener interface

extended from the generic java.util.EventListener.

(a) thread (b) event (c) Listener (d) none of the above

51. ----------- keyword is used, If we need to access the methods or variables in the

parent class whose method name is same to that of the derived class.

(a) super (b) this (c) static (d) none of the above

52. A ------------ is a method that is called when an object is created.

(a)this (b) constructor (c) start (d) none of the above

53. The -------- is used to find out the class name to which the object belongs.

(a)getObject (b) class (c) getClass (d) none of the above

54. The ------- keyword can be used where a reference to an object of the current

class type is required.

(a)super (b) this (c) new (d) none of the above

55. ------------- keyword is used to declare a class variable.

(a)super (b) this (c) static (d) none of the above

56. The ------- operator creates a single instance of a named class and return a

reference to that object.

(a)super (b) this (c) new (d) none of the above

57 The process of locating a particular element value in an array is called -----------.

(a)arranging (b) sorting (c) searching (d) none of the above

58---------------sort is to successively compare adjacent elements and swap them if they are out of order.

(a)bubble (b) random (c) linear (d) none of the above

59. ---------- can be defined as a collection of variables of same type that are

referred to by common name.

(a)collection (b) array (c) set (d) none of the above

60. The --------- statement, when executed in a while, for, do-while or switch

structure caused immediate exit from the structure.

(a)break (b) continue (c) loop (d) none of the above

61. In ---------- loop, the condition is checked at the last.

(a)while (b) do-while (c) loop (d) none of the above

62. ---------- method is used for finding the exponentiation of a number.

(a)pow (b) exp (c) power (d) none of the above

63. ----------- symbol is used to assign the value which is in the right hand side to the

variable which is in the left hand side.

(a)= (b) == (c) <> (d) none of the above

64. ------------- is the default browser which supports Java 2.

(a)internet explorer (b) netscape navigator (c) oprah (d) none

65. ------------- relational operator is used for representing "not equal to" condition.

(a)` (b) != (c) <> (d) none of the above

66. ________ method is used to obtain the path of .class file

(a) getCodeBase( ) (b) getClass( ) (c) getDocumentBase( ) (d) none

67. The -------- statement, when executed in a while, for or do-while structure, skips

the remaining statements in the loop body and proceeds with the next iteration of the loop.

(a)break (b) continue (c)loop (d) none of the above

68.An array index starts with -----

(a)0 (b) 1 (c)-1 (d) none of the above

69. The -------- methods and variables cannot be seen by any class other than the one in which they are defined.

(a)protected (b)public (c)private (d) none of the above

70.------------- is used to accept input from the user.

(a)stream (b)InputStreamReader (c)outputstreamreader (d) none

PART B (2 * 10 = 20 Marks)

(Note: Write any 2 programs from the following questions.)

1.Write a program to sort the given array in Ascending order

2.Write a program to draw the given shapes in the Applet

a)Line

b)Rectangle

c)Polygon

d)Arc

e)Oval

3.Write an error handling program to divide two numbers when divided

by zero

PART C (1 * 10 = 10 Marks)

(Note: Find out the errors in the following program and write down the correct program.)

1.

import javax . awt . *;

public class nonstaticmethod

{

String x, y;

static int z;

void getdata()

{

int a, b;

a = JOptionPane.showInputDialog("Enter the first

no");

b = JOptionPane.showInputDialog("Enter the second no");

x = Integer.parseInt(a);

y = Integer.parseInt(b);

}

void display()

{

system.out.println(" The result of x + y is " + (x+y));

}

Public Static Void Main(string args[])

{

nonstaticmethod obj1 = new nonstaticmethod();

getdata();

display();

z = 10000;

System.out.println("The value of class variable z is " + z );

}

}

华东交通大学2003—2004学年第二学期考试卷 Java语言课程课程类别:必、限、任

春社交礼仪模拟试卷三及答案

模拟试卷(三)(第七至第九章) 一、填空题 1、迎宾礼仪的核心就是要礼待宾客。 2、若三人并行,通常中间的位次最高,内侧的位次居次,外侧的位次 最低,宾主之位此时可酌情而定。 3、出入无人控制的电梯时,引导者须先入后出。 4、一般而言,谈判礼仪重点涉及谈判地点、谈判座次、谈判表现等三个方面。 5、横桌式谈判,除双方主谈者居中就座而外,各方的其他人士按先右后左、自 高而低的顺序分别在己方一侧就座。 6、谈判双方主谈者的右侧之位,在国内谈判中可坐副手,而在涉外谈判中则应由译员就 座。 7、参加谈判前,应认真修饰个人仪表,尤其要选择端庄、雅致的发型,一般不宜染彩发。男士应剃净胡须,女士应化淡妆。 8、演讲是演和讲的结合,既是一种听觉艺术,也是一种视觉艺术。“演”是运用无声的态势语言,包括面部表情、手势、身姿、着装等。 9、递、接名片的时候,如果是单方递、接,应用双手递、双手接;若双方同时交换名片,则应右手递,左手接。 10、与不同关系的人交谈时,双方应保持相应的交谈距离。如与陌生人交谈时,两人的间距约为1.5 米左右;与熟人交谈时,相距 1 米左右;与亲友交谈时,距离0.5 米左 右。 二、单项选择题 1、横桌式谈判,客方人员,主方人员。( C ) A.面门而坐随便坐 B.随便坐背门而坐 C.面门而坐背门而坐 D.背门而坐面门而坐 2、谈判的双方一般保持( B )的距离。 A.0.5~1米 B.1~1.5米 C.1.5~2米 D.2~3米 3、在社交场合中,握手作为一种礼节应用广泛。上下级握手,( A )伸出手。 A.下级要等上级先 B.上级要等下级先 C.必须同时 D.随便哪一方先 4、长幼握手,( A )伸出手。 A.年轻者要等年长者先 B.年长者要等年轻者先 C.必须同时 D.随便哪一方先 5、男女握手,( A )。 A.男士要等女士伸出手后,方可伸手握之 B.女士要等男士伸出手后,方可伸手握之 C.必须同时伸出手 D.随便哪一方先伸出手

JAVA期末考试试卷

天津城市建设学院2007~2008学年第二学期 《 java 语言程序设计A 》 试题A 卷 课程号:073101-0 试卷说明:闭卷考试,时间120分钟。 一、 填空(本题共15空,每空2分,共30分) 1.如果一个java 源程序文件中定义有4个类,使用sun 公司的JDK 编译器javac 编译该源程序文件将产生_____4___个文件名与类名相同扩展名为___.Class_____的字节码文件。 2.Java 中所有类都是类 __Object__的子类。 3.请填出在java .lang 包中与下列基本数据类型相对应的封装类: float :java .lang .Float , char : _ java .Lang.char_______, boolean : ___ java .Lang.boolean_____。 4.被关键字____final______修饰的方法是不能被当前类的子类重新定义的方法 5.线程的四种状态是__新建_____ 、_运行_ 、_中断 、__死亡___。 6.java 语言中__https://www.360docs.net/doc/075263528.html,ng.Objet ___是所有类的根。 7.Swing 的事件处理机制包括__事件的监听者__、事件和事件处理者。 8.URL_____Uniform Resourse Locator_____是的缩写。 9.java 有两类应用程序java Application 和____java 10.转义字符以___\__开头。 二、选择(本题共20小题,每题2分,共40分) 1.欲构造ArrayList 类的一个实例,此类继承了List 接口,下列哪个方法是正确的 ? ( B ) A 、 ArrayList myList=new Object (); B 、 List myList=new ArrayList (); C 、 ArrayList myList=new List (); D 、 List myList=new List (); 2.paint()方法使用哪种类型的参数? ( A ) A 、 Graphics B 、 Graphics2D C 、 String D 、 Color 3.指出正确的表达式 ( C ) A 、 byte=128; B 、 Boolean=null; C 、 long l=0xfffL; D 、 double=0.9239d; 4.指出下列程序运行的结果 ( 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'; } } B 、 good and abc B 、 good and gbc C 、test ok and abc D 、 test ok and gbc 5.运行下列程序, 会产生什么结果 ( A )

java模拟试题附答案(一)

scjp模拟试题(一) Question No: 1 1.public class test ( 2. public static void main (String args[]) { 3. int i = 0xFFFFFFF1; 4. int j = ~i; 5. 6. } 7. ) What is the decimal value of j at line 5? A. 0 B. 1 C. 14 D. –15 E. An error at line 3 causes compilation to fail. F. An error at line 4 causes compilation to fail. 答案: C Question No: 2 Given: Integer i = new Integer (42); Long 1 = new Long (42); Double d = new Double (42.0); Which two expressions evaluate to True? (Choose Two) A. (i ==1) B. (i == d) C. (d == 1) D. (i.equals (d))

E. (d.equals (i)) F. (i.equals (42)) 答案: D, E Question No: 3 Exhibit : 1. public class test ( 2. private static int j = 0; 3. 4. private static boolean methodB(int k) ( 5. j += k; 6. return true; 6. ) 7. 8. public static void methodA(int i) { 9. boolean b: 10. b = i < 10 | methodB (4); 11. b = i < 10 || methodB (8); 12. } 13. 14. public static void main (String args[] ) ( 15. methodA (0); 16. system.out.printIn(j); 17. ) 18. ) What is the result? A. The program prints “0” B. The program prints “4” C. The program prints “8”

模拟的试卷3及答案

模拟试卷三 一、选择题(请将正确答案的序号填写在题中的括号中。每题2分,满分30分) 1、车床上,刀尖圆弧只有在加工()时才产生加工误差。 (A)端面(B)圆柱(C)圆弧 2、在铣削一个凹槽的拐角时,很容易产生过切。为避免这种现象的产生,通常采取的措施是()。 (A)降低进给速度(B)提高主轴转速(C)更换直径大的铣刀 3、数控机床的组成部分是()。 (A)硬件、软件、机床、程序 (B)数控装置、主轴驱动、主机及辅助设备 (C)I/O设备、数控装置、伺服系统、机床主体及反馈装置 (D)I/O设备、数控装置、控制软件、主机及辅助设备 4、根据ISO标准,数控机床在编程时采用()规则。 (A)刀具相对静止,工件运动(B)工件相对静止,刀具运动 (C)按实际运动情况确定(D)按坐标系确定 5、G91 G00 X40.0 Y-20.0 表示()。 (A)刀具按进给速度移至机床坐标系X=40 mm、Y=-20 mm 点(B)刀具快速移至机床坐标系X=40 mm、Y=-20 mm 点

(C)刀具快速向X正方向移动40mm、Y负方向移动20 mm (D)编程错误 6、在数控铣床上铣一个正方形零件(外轮廓),如果使用的铣 刀直径比原来小1mm,则计 算加工后的正方形尺寸差()。 (A)小1mm (B)小0.5mm (C)大1mm (D) 大0.5mm 7、下面()是程序段号的正确表达方式。 (A)N0001 (B)O0001 (C)P0001 (D)X0001 8、从子程序返回到主程序用()。 (A)M98 (B)M99 (C)G98 (D)G99 9、数控系统常用的两种插补功能是()。 (A)直线插补和圆弧插补(B)直线插补和抛物线 插补 (C)圆弧插补和抛物线插补(D)螺旋线插补和和抛 物线插补 10、数控机床是采用数字化信号对机床的()进行控制。 (A)运动(B)加工过程 (C)运动和加工过程(D)无正确答案 11、按照数控机床运动的控制轨迹分类,加工中心属于()。 (A)点位控制(B)直线控制(C)轮廓控制(D) 远程控制 12、下列()不是螺纹加工指令。 (A)G76 (B)G92 (C)G32 (D)G90

Java期末考试试卷答案A

JAVA程序设计试卷库(第5套) 一、单选题(每小题 2 分,共 20 分) 1、Java Application源程序的主类是指包含有( A )方法的类。 A. main方法 B. toString方法 C. init方法 D. actionPerfromed方法 2、分析下面的程序段,下面的哪个描述是正确的。( B ) char mychar=’c’; switch(mychar){ default: case ‘a’“a”);break; case ‘b’“b”);break; } A.switch语句块是错误的, 因为switch后面的表达式 值的类型不是整数; B.switch语句块是正确的; C.switch语句块是错误的, 因为default没有放在语 句块的最后面; D.代码运行时,没有任何输出 结果。 3、编译并运行下面的Java程序, 将产生( B )结果。 class A{ int var1=1; int var2; public static void main(String[] args){ int var3=3; A a=new A(); } } A. 0 B. 4 C. 3 D. 代码无法编译,因为var2根本 没有被初始化 4、在Java中,下面关于包的陈述 中正确的是( D )。

A. 包的声明必须是源文件的任意位置; B. 包的声明必须紧跟在import 语句的后面; C. 只有公共类才能放在包中; D. 可以将多个源文件中的类放在同一个包中 5、 在Java 语言中,当一个类的某个变量声明为protected 时下列说法正确的是( C )。 A. 只有同一类中的成员才能访问它; B. 不同包中的任何其他类都能够访问它; C. 同包中的任何其他类能够访问它; D. 不同包中的子类不可以访问该变量。 6、在Java 中,执行下面的语句后,c 的值为( D )。 String s= "Jessica "; char c=s.charAt(6); A. "c " B. "a " C. 'c ' D. 'a ' 7、设有下面两个赋值语句: a = Integer.parseInt(“1024”); b = Integer.valueOf(“1024”).int Value(); 下述说法正确的是( D )。 A .a 是整数类型变量,b 是整数类对象。 B .a 是整数类对象,b 是整数类型变量。 C .a 和b 都是整数类对象并且它们的值相等。 D .a 和b 都是整数类型变量并且它们的值相等。 8、事件剪裁类如WindowAdapter (它实现了WindowListener 接

java考试试卷模拟试卷

华东交通大学软件学院03~04第二学期Java试卷 班级姓名学号 一、选择題(40分) 1、在Java中,哪个修饰符定义的变量可通过类名来访问。 A. public B. static C.protected D.private 2.在浏览器中执行applet 程序,哪个方法最先执行( )。 A. paint () B. start() C. init() D. repaint() 3、下列关于修饰符混用的说法,错误的是( ) A.abstract不能与final并列修饰同一个类 B.abstract类中不可以有private的成员 C.abstract方法必须在abstract类中 D.static方法中能处理非static的属性 4、以下代码段执行后的输出结果为() int x=3; int y=10; System.out.println(y%x); A. 0 B. 1 C. 2 D. 3 5、Java中,()类是所有类的最终祖先? A. String B. Nuber C. Lang D. Object 6、以下标识符中哪项是不合法的( ) A. Great B. many C. int D. _x1 7、 Java语言中,长整数占用的存储字节数是( )。 A. 4 B. 8 C. 16 D.2 8、设有下面两个赋值语句: a = Integer.parseInt(“1024”); 就是将String字符类型数据转换为Integer整型数据,args[0]就是输入参数中的第一个参数字符串。 b = Integer.valueOf(“1024”) ;

(2)valueOf方法将传入的参数String转化为int型值 下述说法正确的是()。 A.a是整数类型变量,b是整数类对象。 B.a是整数类对象,b是整数类型变量。 C.a和b都是整数类对象并且它们的值相等。 D.a和b都是整数类型变量并且它们的值相等。 9、若在某一个类定义中定义有如下的方法:abstract void performDial( ); 该方法属于( )。 A. 本地方法 B. 最终方法 C. 静态方法 D. 抽象方法 10、下面哪个包是用于创建图形用户界面的( )。 A. java.applet B. java.awt C. https://www.360docs.net/doc/075263528.html,ng D. java.util 11、通过哪个方法可以改变按钮的颜色 A. setColor B. setBackground C. getBackground E. setForeground 12、编译和解析执行一个java应用程序应分别采用的命令是() A. Java和Javac B. Javac和Java C. Javap和Java D. Javac和Jdb 13、以下程序段: switch(m) { case 0: System.out.println("case 0"); case 1: System.out.println("case 1"); break; case 2: default: System.out.println("default"); } m为何值时程序的输出是“default”? A. 0 B. 1 C. 2 D. 3 14. 定义一个1维整型数组,正确的是: (A) int a[]= new int [10];

大学英语(三)模拟试卷和答案

Network Education College, BLCU 《大学英语(三)》模拟试卷一 注意: 1.试卷保密,考生不得将试卷带出考场或撕页,否则成绩作废。请监考老师负责监督。 2.请各位考生注意考试纪律,考试作弊全部成绩以零分计算。 3.本试卷满分100分,答题时间为90分钟。 4.本试卷分为试题卷和答题卷,所有答案必须答在答题卷上,答在试题卷上不给分。 I.Multiple Choice. (1 point for each, altogether 30 points) Directions:There are 30 sentences in this section. Beneath each sentence there are four choices respectively marked by letters A, B, C and D. Choose the word that you think best complete the sentence. Write your answers on the answer sheet. 1. There is no_______in insisting on his agreement. [A] meaning[B] sense [C] mine[D] benefit 2. We_______to get what we want, anyway. [A] managed[B] believed [C] handled[D] operated 3. It is beautiful when many birds_______the island during the autumn months. [A] fly[B] come [C] settle[D] visit 4. His mother was laid off last month. As a result, the income of the family was_______more than one-third. [A] increased[B] dropped off [C] cut down[D] come to 5. How far was he_______for what had happened? [A] respective[B] respectful [C] reliable[D] responsible 6. My father often takes_______of the fine weather to do some gardening. [A] advantage[B] interest [C] charge[D] use 7. Don’t_______too much from him. [A] expose[B] expect [C] express[D] experience

java考试试卷及答案

JA V A考试试卷及答案 选择题 3、在Java Applet程序用户自定义的Applet子类中,一般需要重载父类的( D )方法来完成一些画 图操作。 A. start() B. stop() C. init() D. paint() 3、Java语言具有许多优点和特点,下列选项中,哪个反映了Java程序并行机制的特点?B A)安全性B)多线程C)跨平台D)可移植 4、下列哪个类声明是正确的?D A)abstract final class HI{···}B)abstract private move(){···} C)protected private number; D)public abstract class Car{···} 6、在Java语言中,下列哪些语句关于内存回收的说明是正确的? B A.程序员必须创建一个线程来释放内存; B.内存回收程序负责释放无用内存 C.内存回收程序允许程序员直接释放内存 D.内存回收程序可以在指定的时间释放内存对象 10、下列Object类中的方法,哪一项不是完全跟线程有关:A A.String toString() B.void notify() C.void notifyAll() D.void wait() 11、给出下面代码:C

public class Person{ static int arr[] = new int[10]; public static void main(String a[]) { System.out.println(arr[1]); } } 下列说法中正确的是? A.编译时将产生错误; B.编译时正确,运行时将产生错误; C.输出零; D.输出空。 12、字符串是Java已定义的类型,关于它的构造函数,下面说法不正确的是:B A.String(char[] value, int offset, int count) B.String(int[] codePoints,int offset, int count) C.String(String original) D.String(StringBuffer buffer) 13、下列说法中正确的是:C A.导入包会影响程序的性能 B.包存储在类库中 C.包是类的容器D.上述说法都不对 14、下列不是String类的常用方法是:C

Java期末考试题

2010年——2011年Java期末考试题 一、判断题。 1.Java语言是平台无关的语言。T 2.类的静态方法中可以访问该类的非静态数据成员.F 3.Java中方法调用时参数传递都是按值传递的,因此从方法中退出时,参数的值是不 会变的。T 4.覆盖方法所抛出的异常不能比原方法更多。T 5.Final 方法不能被覆盖。T 6.抽象类中一定包含抽象方法。F 7.接口中的方法必须是抽象方法。T 8.在方法定义中,所以可能发生的异常都必须用try{} catch(){}捕捉。F 9.Java支持多重继承。F 10.Final修饰的类不能派生子类。T 11.覆盖的同名方法中,子类方法不能比父类方法的访问权限更严格。T 12.不能在静态方法中使用this.T 13.抽象类中不能创建对象。T 14.一个类可以实现多接口。T 15.接口中可以包含非静态成员。F 16.不论是否捕捉到异常try{}catch(){} final{}语句中finally块中的代码总要被执行。T 17.一个类实现一个接口,则该类必须实现接口中的所有方法。F 18.线程使用sleep方法去休眠后可以使用notify方法唤醒。F 19.线程使用sleep方法休眠是会释放该线程同步锁定的对象。F 20.Final类中的属性和方法都必须是final的。F 二、选择题 1、Java中复合数据类型不包括(D) A.类类型 B.数组 C.接口类型 D.指针 2、请从四个选项中选择答案,下列代码的执行结果是:(C) Public class Test{ Public static void main(String args[]){ Float t=9.0f; Int q=6; System.out.println((t++)*(--q)); } } A.40 B.40.0 C.45.0 D.36.0 3、下列关于修饰符混用的说法,错误的是(D) A.abstract 不能与final 并列修饰同一个类 B.abstract类中可以有非abstract的方法 C.普通类(非abstract类)中不能有abstract方法 D.static方法中能处理非static的属性 4、关于被保护访问控制符protected修饰的成员变量,以下说法正确的是(A) A.可以被该类自身、与它在同一个包中的其它类、在其它包中的该类的子类所访问B.只能被该类本身和该类的所有的子类访问 C.只能被该类自身所访问 D.只能被同一个包中的类访问 5、x=2,y=3,z=4,则表达式z*=y++*--x的值是(A) A.12 B.24 C.16 D.3 6、以下赋值语句正确的是(D) A.char c1=”a” B.float f1=3.22 C.byte b1=266 D.long L1=0xAC8L 7、Java不支持多重继承,但我们可以通过(B)实现 A.多态 B.接口 C.覆盖 D.抽象类 8.已知类person是类student的父类,以下数组定义和赋值哪些是正确的(A) A. person p[]=new person[3]; p[1]=new student(); B .student s[]=new person[3]; s[1]=new person(); C .person p[]= new student[3];p[1]= new person(); D .student s[]=new student[3];s[1]=new person; 9 编译MyClass.java之后,得到了三个字节码文件:MyClass.class , MyClasslittle$.class MyClass$1.class.这表明(C) A.MyClass类中的两个方法:little和1 B. MyClass.Java中有三个类:MyClass、little和1 C. MyClass类中有两个内部类:一个是命名的little,另一个是匿名的1 D. MyClass、little和1,这三者没什么关系 10、main 方法是java Application 程序执行的入口点,关于main方法的方法头以下(B)是合法的。 A.public static void main() B.public static void main(String arg[]) C.public static int main(String[] arg) D. B.public void main(String arg[]) 11、当编译和运行下面的代码会出现什么情况?(A)

java模拟试卷3与答案

复习题 3 一、选择题 1. JDK 提供的编译器是(B)。 (A ) java.exe(B ) javac.exe (C) javap.exe( D) javaw.exe 2.以下作为 Java 程序入口的 main 方法声明正确的( C)。 (A ) public void main(String args[]) (B ) public int main(String args[]) (C) public static void main(String args[]) (D ) public static int main(String args[]) 3.以下标识符错误的是( C )。 (A )Public( B)张三( C) class(D ) main 4.java 中定义字符串 String s= ”pzhu”,下面操作可以取得字符串长度的是( A )。 (A ) s.length()( B) s.length( C)s.size()( D) length(s) 5.如下定义数组,操作正确的是(D)。 int a[]={1,2,3}; (A ) a[3]=100(B ) a[0].length( C)a++( D) a.length 6.如下定义二维数组操作错误的是()。 int a[][]={{1,2},{3}}; (A ) a[0][1]=200( B) a[0].length( C) a[1][1]=100( D) a.length 7. 以下数据类型存储空间最大的是(B)。 (A ) byte( B) long(C) float(D ) char 8. 面向对象的三大特性,不包括如下( A)。 (A )异常( B)封装(C)继承(D )多态 9、关于类的定义以下说法错误(B)。 (A )类定义使用class 关键字( B)每个类中必须有一个main 方法 (C)一个包可以包含多个类( D) java 中所有类都是Object 类的子类 10. 关于构造方法以下说法错误的是(D)。 (A)构造方法名必须与类名一致(B)构造方法可以重载 (C)构造方法是通过new 来调用(D)每个类都必须编写构造方法代码 11.关于继承如下说法错误的是(C)。 (A) Java 是单继承的(B)通过extends 来定义继承 (C)所有父类方法都可以被override的(D)继承呈现的是 is a 的关系 12.以下代码执行的结果是 ( C )。 System.out.println(" 攀枝花学院 pzhu".length()); (A)编译错误(B)运行错误(C) 9(D) 14 13. 用来存储键值对的容器是 ()。 (A )ArrayList( B ) LinkedList(C) HashSet( D) HashMap 14、 java 中用来抛出异常的关键字是( C )。 (A) try(B) catch(C) throw(D) throws 15.关于 finally块中的代码,以下说法不正确的是(A)。 (A ) try 块中的 return 语句会中断finally 块中语句的执行 (B )无论 finally 块前的语句运行是否产生异常,其中的语句都会执行 (C) finally 块中的语句通常中用作资源的清理 - 1 -

模拟试卷三及答案

励才九年级思想品德试卷2015.5.3 (考试时间:60分钟试卷满分:50分考试形式:闭卷)友情提醒:态度决定一切,细节决定成败。请同学们务必做到:仔细审题, ....。 ....,卷面整洁 .....书写工整 题号 1 2 3 4 5 6 7 8 9 10 答案 题号11 12 13 14 15 16 17 18 19 20 答案 1.“横看成岭侧成峰,远近高低各不同。不识庐山真面目,只缘身在此山中。”从认识自己的角度看,这首诗给我们的启示是 A.只有多角度欣赏庐山,才能获得对庐山的客观全面认识 B.要更客观地认识自己,应参考他人和集体对自己的评价 C.角度不同,产生的认识就会不同,因而人无法认识自己 D.我们应用发展的眼光认识自己,不断改正缺点完善自己 2.尊重他人人格的前提是 A.经济地位的平等 B.智力水平的平等 C.认识人与人之间在人格上是平等的 D.受教育程度的平等 3.现实生活中,我们会遇到各种各样的“标志线”,下列属于关爱公民生命健康权的“标志线”是 ①横穿马路的斑马线②施工现场的警戒线③银行窗口的一米线④火车站台的候车线 A.①②③ B.②③④C.①②④ D.①③④ 4.从国家的繁荣发展和对公民的要求来讲,受教育 A.既是公民的权利又是公民的义务 B.是我国公民的一项基本权利 C.是我国公民的一项基本义务 D.既不是公民的权利也不是公民的义务 5.“有所许诺,纤毫必偿;有所期约,时刻不易。”对此理解正确的是 A.承诺时应量力而行 B.一诺千金,只对好朋友兑现承诺 C.承诺后要尽力而为D.许诺后应不惜一切代价兑现承诺 6.中国共产党成立以来,中国经历了“站起来——富起来——逐步强起来”的发展历程。我国实现由“富起来”到“逐步强起来”的根本保证是 A.坚持了中国共产党的领导 B.坚持了独立自主的和平外交政策 C.坚持了依法治国的基本方略 D.坚持了中国特色社会主义理论体系 7.网络的迅猛发展在给信息交流带来便捷方便的同时,也使谣言“插上了翅膀”。更多的民众认识到,丰富的表达渠道不过是“麦克风”,要想发出“好声音”,还要练就“好嗓子”。作为公民,在网络世界练就“好嗓子”必须 A.坚持依法治国,治理网络谣言 B.创造多种条件,畅通表达渠道 C.依法行使权利,自觉履行义务 D.完善监督机制,提高道德素质 8.媒体人柴静自费拍摄的纪录片《穹顶之下》引发热议,有网友评论:“这里涵盖了17条与雾霾相关的常识,这是全民第一次如此严肃的看待空气问题”。柴静的这一行为 A.是公民依法参与经济生活的表现B.是公民主动承担社会责任的表现 C.不利于国家的稳定和社会的发展D.能够彻底解决我国大气污染问题 9.作为学生,我们的根本活动准则是 A.《中学生守则》B.《中学生日常行为规范》 C.《宪法》 D.《治安管理处罚法》

2020年计算机二级《JAVA》模拟简单应用试题

2020年计算机二级《JAVA》模拟简单应用试题 三、简单应用题 本题的功能是对下拉菜单项的操作,包括添加和删除。页面包括一个下拉菜单、一个文本框和两个按钮“删除”和“添加”,选中下拉菜单的一项后,能够通过“删除”按钮从下拉菜单中删除该项,在文本框中填入字符串后,单击“添加”按钮就能够将该项添加到下拉菜单中,所有信息都将显示在右侧的文本域中。 import java.awt.*; import java.awt.event.*; public class java2 extends java.applet.Applet imple- ments hemListener,ActionListener {Choice choice; TextField text; TextArea area; Button add,del; public void init() . {choice:new Choice(); text=new TextField(8); area:new TextArea(6,15); choice.add("音乐天地"); choice.add("武术天地"); choice.add("象棋乐园");

choice.add("交友聊天"); add=new Button("添加"); del=new Button("删除"); add.addActionListener(this); del.addActionListener(this); choice.addItemListener(this); add(choice); add(del);add(text);add(add);add(area); } public void itemStateChanged(hemEvent e) {String name= ; int index=choice.getSelectedIndex(); area.setText("\n"+index+":"+name); } public void actionPerformed(ActionEvent e) {if(e.getSource()= =add||e.getSource()= = text) {String name=text.getText(); if(name.length()>0) {choice.add(name); choice.select(name);

JAVA期末考试考卷及答案

《J A V A语言程序设计》期末考试模拟试题 一、单选择题(每小题2分,共10分) 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、在Java Applet程序用户自定义的Applet子类中,一般需要重载父类的( D )方 法来完成一些画图操作。 A. start( ) B. stop( ) C. init( ) D. paint( ) 4、不允许作为类及类成员的访问控制符的是( C )。 A. public B. private C. static D. protected 5、为AB类的一个无形式参数无返回值的方法method书写方法头,使得使用类名AB作为 前缀就可以调用它,该方法头的形式为( A )。 A. static void method( ) B. public void method( ) C. final void method( ) D. abstract void method( ) 二、填空题(每空格1分,共20分) 1、开发与运行Java程序需要经过的三个主要步骤为编辑源程序、 编译生成字节码和解释运行字节码。

MyApplet必须是 Applet 类的子类并且存储该源程序文件的文件名为MyApplet 。 3、如果一个Java Applet程序文件中定义有3个类,则使用Sun公司的JDK编译 器编译该源程序文件将产生 3 个文件名与类名相同而扩展名为 . class 的字节码文件。 4、在Java的基本数据类型中,char型采用Unicode编码方案,每个Unicode码占 用 2 字节内存空间,这样,无论是中文字符还是英文字符,都是占 用 2 字节内存空间。 5、设 x = 2 ,则表达式 ( x + + )/3 的值是 1 。 6、若x = 5,y = 10,则x < y和x >= y的逻辑值分别为 true 和 false 。 7、抽象(abstract)方法方法是一种仅有方法头,没有具体方法体和操作实现的方法,该方法必须在抽象类之中定义。最终(final)方法方法是不能被当前类的子类重新定义的方法。 8、创建一个名为 MyPackage 的包的语句是 package MyPackag , 该语句应该放在程序的位置为:应该在程序第一句。 9、设有数组定义:int MyIntArray[ ] = { 10 , 20 , 30 , 40 , 50 , 60 , 70}; 则执行以下几个语句后的输出结果是 120 。 int s = 0 ; for ( int i = 0 ; i < ; i + + ) if ( i % 2 = = 1 ) s += MyIntArray[i] ; 10、在Java程序中,通过类的定义只能实现单重继承,但通过接口的定义可以实现多重继承关系。

JAVA试题及答案

JA V A语言基础内部测试题 选择题(针对以下题目,请选择最符合题目要求的答案,针对每一道题目,所有答案都选对,则该题得分,所选答案错误或不能选出所有答案,则该题不得分。)(每题2分) 没有注明选择几项的,只选择一项 1、JAVA所定义的版本中不包括:() A、JAVA2 EE B、JAVA2 Card C、JAVA2 ME D、JAVA2 HE E、JAVA2 SE 2、下列说法正确的是() A、JAVA程序的main方法必须写在类里面 B、JAVA程序中可以有多个main方法 C、JAVA程序中类名必须与文件名一样 D、JAVA程序的main方法中如果只有一条语句,可以不用{}(大括号)括起来 3、Java中,在如下所示的Test类中,共有()个构造方法。 public class Test{ private int x; public Test(){ x=35; } public void Test(double f){ =(int)f; } public Test(String s){} } A、0 B、 1 C、 2 D、3 4、变量命名规范说法正确的是() A、变量由字母、下划线、数字、$符号随意组成; B、变量不能以数字作为开头; C、A和a在java中是同一个变量; D、不同类型的变量,可以起相同的名字; 5、下列javaDoc注释正确的是() A、/*我爱北京天安门*/

B、quals("john") C、"john" = "john" D、"john".equals(new String("john")) 6、下列输出结果是() int a = 0 ; while ( a < 5 ) { switch(a){ case 0: case 3 : a = a + 2; case 1 : case 2 : a = a + 3; default : a = a + 5; } } ( a ) ; A、0 B、5 C、10 D、其他 7、下列代码输出结果是( ) int i = 10; while ( i > 0 ){ i = i + 1; if ( i = =10 ){ break; } } A.while循环执行10次 B.死循环 C.循环一次都不执行 D.循环执行一次 8、下面有关for循环的描述正确的是() A、for循环体语句中,可以包含多条语句,但要用大括号括起来 B、for循环只能用于循环次数已经确定的情况 C、在for循环中,不能使用break语句跳出循环 D、for循环是先执行循环体语句,后进行条件判断 9、下列()属于引用数据类型(选择两项) A、String B、char C、用户自定义的Student类类型

数字逻辑模拟试卷3答案

上海应用技术学院2009—2010学年第2学期 《数字电子技术》期(末)(A)试卷 课程代码: B203115 学分: 3 考试时间: 100 分钟 课程序号:1862 1863 1864 1865 班级:学号:姓名: 我已阅读了有关的考试规定和纪律要求,愿意在考试中遵守《考场规则》,如有违反将愿接受相应的处理。 题号一二三四五六七八九十总分 应得分20 8 6 8 16 8 16 8 10 实得分 一、选择填空(每题2分,共20分) 1.2005个1连续异或的结果是( b )。 (a)0 (b)1 (c)不唯一(d)逻辑概念错误 2.用卡诺图化简具有无关项的逻辑函数时,若用圈1法,在包围圈内的x是按( b )处理; 在包围圈外的x是按( )处理。 (a)1,1 (b)1,0 (c)0,0 (d)不确定 3.用三态门可以实现“总线”连接,但其“使能”控制端应为( d )。 (a)固定接0 (b) 固定接1 (c)同时使能(d)分时使能 4.TTL门电路输人端对地所接电阻R≥R ON时,相当于此端( a )。 (a)接逻辑“1”(b)接逻辑“0”(c)接2.4V电压(d) 逻辑不定 5.多路数据选择器MUX的输入信号可以是( d )。 (a)数字信号(b)模拟信号(c)数模混合信号(d)数字和模拟信号 6.两个与非门构成的基本RS锁存器,当Q=1、=0时,两个输入信号R=1和S=1。触发器的输出Q会( b ) 。 (a)变为0 (b)保持1不变(c)保持0不变(d)无法确定 7.某触发器的状态是在CP的下降沿发生变化,它的电路符号应为( b )。

(a)(b)(c)(d) 8.欲把串行数据转换成并行数据,可用(c )。 (a)计数器(b)分频器(c)移位寄存器(d)脉冲发生器9.数字系统中,常用( a )电路,将输入缓变信号变为矩形脉冲信号。 (a)施密特触发器(b)单稳态触发器 (c)多谐振荡器(d)集成定时器 10.把模拟量转换成为相应数字量的转换器件称为( d )。 (a)数—模转换器(b)DAC (c)D/A转换器(d)ADC 二、用卡诺图法化简函数(8分) (1) 解:本题的卡诺图如图1所示: 1 1 1 1 A B C D 1 图1 1 1 1 1 1 其化简结果为:

相关文档
最新文档