JAVA程序员应聘编程能力测试(英文版).docx

上传人:rrsccc 文档编号:9863037 上传时间:2021-03-31 格式:DOCX 页数:43 大小:29.21KB
返回 下载 相关 举报
JAVA程序员应聘编程能力测试(英文版).docx_第1页
第1页 / 共43页
JAVA程序员应聘编程能力测试(英文版).docx_第2页
第2页 / 共43页
JAVA程序员应聘编程能力测试(英文版).docx_第3页
第3页 / 共43页
JAVA程序员应聘编程能力测试(英文版).docx_第4页
第4页 / 共43页
JAVA程序员应聘编程能力测试(英文版).docx_第5页
第5页 / 共43页
点击查看更多>>
资源描述

《JAVA程序员应聘编程能力测试(英文版).docx》由会员分享,可在线阅读,更多相关《JAVA程序员应聘编程能力测试(英文版).docx(43页珍藏版)》请在三一文库上搜索。

1、JAVA程序员应聘编程能力测试(英文版)Q. 1Which color is used to indicate instance methods in the standard javadoc format documentation:A. blueB. redC. purpleD. orangeJava Certification Mock Exam 2/36Select the most appropriate answer.Q. 2What is the correct ordering for the import, class and package declarations whe

2、n found in a single file?A. package, import, classB. class, import, packageC. import, package, classD. package, class, importSelect the most appropriate answer.Q. 3Which methods can be legally applied to a string object?A. equals(String)B. equals(Object)C. trim()D. round()E. toString()Select all cor

3、rect answers.Q. 4What is the parameter specification for the public static void main method?A. String args B. String argsC. Strings args D. String argsSelect all correct answers.Q. 5What does the zeroth element of the string array passed to the public static void mainJava Certification Mock Exam 3/3

4、6method contain?A. The name of the programB. The number of argumentsC. The first argument if one is presentSelect the most appropriate answer.Q. 6Which of the following are Java keywords?A. gotoB. mallocC. extendsD. FALSESelect all correct answersQ. 7What will be the result of compiling the followin

5、g code:public class Test public static void main (String args ) int age;age = age + 1;System.out.println(The age is + age);A. Compiles and runs with no outputB. Compiles and runs printing out The age is 1C. Compiles but generates a runtime errorJava Certification Mock Exam 4/36D. Does not compileE.

6、Compiles but generates a compile time errorSelect the most appropriate answer.Q. 8Which of these is the correct format to use to create the literal char value a?A. aB. aC. new Character(a)D. 000aSelect the most appropriate answer.Q. 9What is the legal range of a byte integral type?A. 0 - 65, 535B. (

7、128) 127C. (32,768) 32,767D. (256) 255Select the most appropriate answer.Q. 10Which of the following is illegal:A. int i = 32;B. float f = 45.0;C. double d = 45.0;Select the most appropriate answer.Q. 11What will be the result of compiling the following code:Java Certification Mock Exam 5/36public c

8、lass Test static int age;public static void main (String args ) age = age + 1;System.out.println(The age is + age);A. Compiles and runs with no outputB. Compiles and runs printing out The age is 1C. Compiles but generates a runtime errorD. Does not compileE. Compiles but generates a compile time err

9、orSelect the most appropriate answer.Q. 12Which of the following are correct?A. 128 1 gives 64B. 128 1 gives 64C. 128 1 gives 64D. 128 1 gives 64Select all correct answersQ. 13Which of the following return true?A. john = johnB. john.equals(john)C. john = johnJava Certification Mock Exam 6/36D. john.

10、equals(new Button(john)Select all correct answers.Q. 14Which of the following do not lead to a runtime error?A. john + was + hereB. john + 3C. 3 + 5D. 5 + 5.5Select all correct answers.Q. 15Which of the following are so called short circuit logical operators?A. &B. |C. &D. |Select all correct answer

11、s.Q. 16Which of the following are acceptable?A. Object o = new Button(A);B. Boolean flag = true;C. Panel p = new Frame();D. Frame f = new Panel();E. Panel p = new Applet();Select all correct answers.Q. 17Java Certification Mock Exam 7/36What is the result of compiling and running the following code:

12、public class Test static int total = 10;public static void main (String args ) new Test();public Test () System.out.println(In test);System.out.println(this);int temp = this.total;if (temp 5) System.out.println(temp);A. The class will not compileB. The compiler reports and error at line 2C. The comp

13、iler reports an error at line 9D. The value 10 is one of the elements printed to the standard outputE. The class compiles but generates a runtime errorSelect all correct answers.Q 18Java Certification Mock Exam 8/36Which of the following is correct:A. String temp = new String j a z;B. String temp =

14、j b c;C. String temp = a, b, c;D. String temp = a, b, c;Select the most appropriate answer.Q. 19What is the correct declaration of an abstract method that is intended to be public:A. public abstract void add();B. public abstract void add() C. public abstract add();D. public virtual add();Select the

15、most appropriate answer.Q. 20Under what situations do you obtain a default constructor?A. When you define any classB. When the class has no other constructorsC. When you define at least one constructorSelect the most appropriate answer.Q. 21Given the following code:public class Test Java Certificati

16、on Mock Exam 9/36Which of the following can be used to define a constructor for this class:A. public void Test() B. public Test() C. public static Test() D. public static void Test() Select the most appropriate answer.Q. 22Which of the following are acceptable to the Java compiler:A. if (2 = 3) Syst

17、em.out.println(Hi);B. if (2 = 3) System.out.println(Hi);C. if (true) System.out.println(Hi);D. if (2 != 3) System.out.println(Hi);E. if (aString.equals(hello) System.out.println(Hi);Select all correct answers.Q. 23Assuming a method contains code which may raise an Exception (but not a RuntimeExcepti

18、on), what is the correct way for a method to indicate that it expects thecaller to handle that exception:A. throw ExceptionB. throws ExceptionC. new ExceptionD. Dont need to specify anythingSelect the most appropriate answer.Q. 24What is the result of executing the following code, using the paramete

19、rs 4 and 0:Java Certification Mock Exam 10/36public void divide(int a, int b) try int c = a / b; catch (Exception e) System.out.print(Exception ); finally System.out.println(Finally);A. Prints out: Exception FinallyB. Prints out: FinallyC. Prints out: ExceptionD. No outputSelect the most appropriate

20、 answer.Q.25Which of the following is a legal return type of a method overloading the followingmethod:public void add(int a) A. voidB. intC. Can be anythingSelect the most appropriate answer.Q.26Java Certification Mock Exam 11/36Which of the following statements is correct for a method which is over

21、riding thefollowing method:public void add(int a) A. the overriding method must return voidB. the overriding method must return intC. the overriding method can return whatever it likesSelect the most appropriate answer.Q. 27Given the following classes defined in separate files:class Vehicle public v

22、oid drive() System.out.println(Vehicle: drive);class Car extends Vehicle public void drive() System.out.println(Car: drive);public class Test Java Certification Mock Exam 12/36public static void main (String args ) Vehicle v;Car c;v = new Vehicle();c = new Car();v.drive();c.drive();v = c;v.drive();W

23、hat will be the effect of compiling and running this class Test?A. Generates a Compiler error on the statement v= c;B. Generates runtime error on the statement v= c;C. Prints out:Vehicle: driveCar: driveCar: driveD. Prints out:Vehicle: driveCar: driveVehicle: driveSelect the most appropriate answer.

24、Java Certification Mock Exam 13/36Q. 28Where in a constructor, can you place a call to a constructor defined in the super class?A. AnywhereB. The first statement in the constructorC. The last statement in the constructorD. You cant call super in a constructorSelect the most appropriate answer.Q. 29W

25、hich variables can an inner class access from the class which encapsulates it?A. All static variablesB. All final variablesC. All instance variablesD. Only final instance variablesE. Only final static variablesSelect all correct answers.Q. 30What class must an inner class extend:A. The top level cla

26、ssB. The Object classC. Any class or interfaceD. It must extend an interfaceSelect the most appropriate answer.Q. 31In the following code, which is the earliest statement, where the object originally heldin e, may be garbage collected:1. public class Test Java Certification Mock Exam 14/362. public

27、static void main (String args ) 3. Employee e = new Employee(Bob, 48);4. e.calculatePay();5. System.out.println(e.printDetails();6. e = null;7. e = new Employee(Denise, 36);8. e.calculatePay();9. System.out.println(e.printDetails();10.11. A. Line 10B. Line 11C. Line 7D. Line 8E. NeverSelect the most

28、 appropriate answer.Q. 32What is the name of the interface that can be used to define a class that can executewithin its own thread?A. RunnableB. RunC. ThreadableD. ThreadE. ExecutableSelect the most appropriate answer.Q. 33What is the name of the method used to schedule a thread for execution?A. in

29、it();B. start();C. run();D. resume();E. sleep();Java Certification Mock Exam 15/36Select the most appropriate answer.Q. 34Which methods may cause a thread to stop executing?A. sleep();B. stop();C. yield();D. wait();E. notify();F. notifyAll()G. synchronized()Select all correct answers.Q. 35Write code

30、 to create a text field able to display 10 characters (assuming a fixed sizefont) displaying the initial string hello:Q. 36Which of the following methods are defined on the Graphics class:A. drawLine(int, int, int, int)B. drawImage(Image, int, int, ImageObserver)C. drawString(String, int, int)D. add

31、(Component);E. setVisible(boolean);F. setLayout(Object);Select all correct answers.Q. 37Which of the following layout managers honours the preferred size of a component:Java Certification Mock Exam 16/36A. CardLayoutB. FlowLayoutC. BorderLayoutD. GridLayoutSelect all correct answers.Q. 38Given the f

32、ollowing code what is the effect of a being 5:public class Test public void add(int a) loop: for (int i = 1; i for (int j = 1; j if (a = 5) break loop;System.out.println(i * j);A. Generate a runtime errorB. Throw an ArrayIndexOutOfBoundsExceptionC. Print the values: 1, 2, 2, 4D. Produces no outputSe

33、lect the most appropriate answer.Java Certification Mock Exam 17/36Q. 39What is the effect of issuing a wait() method on an objectA. If a notify() method has already been sent to that object then it has no effectB. The object issuing the call to wait() will halt until another object sends a notify()

34、or notifyAll() methodC. An exception will be raisedD. The object issuing the call to wait() will be automatically synchronized with anyother objects using the receiving object.Select the most appropriate answer.Q. 40The layout of a container can be altered using which of the following methods:A. set

35、Layout(aLayoutManager);B. addLayout(aLayoutManager);C. layout(aLayoutManager);D. setLayoutManager(aLayoutManager);Select all correct answers.Q. 41Using a FlowLayout manager, which is the correct way to add elements to a container:A. add(component);B. add(Center, component);C. add(x, y, component);D.

36、 set(component);Select the most appropriate answer.Q. 42Given that a Button can generate an ActionEvent which listener would you expect tohave to implement, in a class which would handle this event?Java Certification Mock Exam 18/36A. FocusListenerB. ComponentListenerC. WindowListenerD. ActionListen

37、erE. ItemListenerSelect the most appropriate answer.Q. 43Which of the following, are valid return types, for listener methods:A. booleanB. the type of event handledC. voidD. ComponentSelect the most appropriate answer.Q. 44Assuming we have a class which implements the ActionListener interface, which

38、method should be used to register this with a Button?A. addListener(*);B. addActionListener(*);C. addButtonListener(*);D. setListener(*);Select the most appropriate answer.Q. 45In order to cause the paint(Graphics) method to execute, which of the following is themost appropriate method to call:A. pa

39、int()B. repaint()C. paint(Graphics)D. update(Graphics)E. None you should never cause paint(Graphics) to executeJava Certification Mock Exam 19/36Select the most appropriate answer.Q. 46Which of the following illustrates the correct way to pass a parameter into an applet:A.B. C.D.Select the most appr

40、opriate answer.Q. 47Which of the following correctly illustrate how an InputStreamReader can becreated:A. new InputStreamReader(new FileInputStream(data);B. new InputStreamReader(new FileReader(data);C. new InputStreamReader(new BufferedReader(data);D. new InputStreamReader(data);E. new InputStreamR

41、eader(System.in);Select all correct answers.Q. 48What is the permanent effect on the file system of writing data to a new FileWriter(report), given the file report already exists?A. The data is appended to the fileB. The file is replaced with a new fileC. An exception is raised as the file already e

42、xistsD. The data is written to random locations within the fileSelect the most appropriate answer.Q. 49Java Certification Mock Exam 20/36What is the effect of adding the sixth element to a vector created in the followingmanner:new Vector(5, 10);A. An IndexOutOfBounds exception is raised.B. The vecto

43、r grows in size to a capacity of 10 elementsC. The vector grows in size to a capacity of 15 elementsD. Nothing, the vector will have grown when the fifth element was added Select the most appropriate answer.Q. 50What is the result of executing the following code when the value of x is 2: switch (x)

44、case 1:System.out.println(1);case 2:case 3:System.out.println(3);case 4:System.out.println(4);A. Nothing is printed outB. The value 3 is printed outC. The values 3 and 4 are printed outD. The values 1, 3 and 4 are printed outJava Certification Mock Exam 21/36Select the most appropriate answer.Q. 51C

45、onsider the following example:class First public First (String s) System.out.println(s);public class Second extends First public static void main(String args ) new Second();What is the result of compiling and running the Second class?A. Nothing happensB. A string is printed to the standard outC. An instance of the class First is generatedD. An instance of the class Second is createdE. An exception is raised at runtime stating that there is no null parameter constructor in class First.F. The class seco

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1