DOC

questions for java(senior and junior)

By Scott Snyder,2014-09-30 20:28
13 views 0
questions for java(senior and junior)

     Questions

    Following questions have two parts, which you should finished

    them within one hour. And you can write the answer in Chinese

    or English.

    Part one: please choose one or more correct answers among the

    given items for each question.

1. Float s=new Float(0.9F);

    Float t=new Float(0.9F);

     Double u=new Double(0.9); Which expression’s result is true?

    A) s==t

    B) s.equals(t)

    C) s==u

    D) t.equals(u)

    2. Give the following java class: public class Example{

    static int x[]=new int[15];

    public static void main(String args[]){ System.out.println(x[5]);

     }

    }

    Which statement is corrected? A) When compile, some error will occur. B) When run, some error will occur. C) Output is zero.

    D) Output is null.

    3. Which is the range of int type? A) -2~16 - 2~16-1

    B)- 2~31 2~31-1

    C) -2~32 - 2~32-1

    D) -2~64 -2~64-1

4. What statements are true concerning the method notify() that is used in

    conjunction with wait()? (Select all valid answers.) A) if there is more than one thread waiting on a condition, only the thread that has

    been waiting the

    longest is notified

    B) if there is more than one thread waiting on a condition,there is no way to predict

    which thread will

    be notifed

    C) notify() is defined in the Thread class

    D) it is not strictly necessary to own the lock for the object you invoke notify() for

    E) notify() should only be invoked from within a while loop

    5. Why might you define a method as native? [multiply choices]

    A) To get to access hardware that Java does not know about B) To define a new data type such as an unsigned integer C) To write optimized code for performance in a language such as C/C++ D) To overcome the limitation of the private scope of a method

6. What is written to the standard output as the result of executing the following

    statements?

    Boolean b1 = new Boolean(true);

    Boolean b2 = new Boolean(true);

if (b1 == b2)

     if (b1.equals(b2))

     System.out.println("a");

     else

     System.out.println("b");

    else

     if (b1.equals(b2))

     System.out.println("c");

     else

     System.out.println("d");

    Select the one right answer.

    A) a

    B) b

    C) c

    D) d

7. char myShip = `c`;

    switch (myShip) {

     default:

     case `a`: System.out.println("a"); break;

     case `b`: System.out.println("b"); break;

}

    Which of the following questions are definitely true? Select all valid answers. A) This switch block is illegal, because only integers can be used in the switch statement.

    B) This switch block is fine.

    C) This switch block is illegal, because the default statement must come last. D) When this code runs, nothing is written to the standard output. E) When this code runs, the letter "a" is written to the standard output.

8. Which of the following statements are true?

    A) Constructors cannot have a visibility modifier

    B) Constructors can be marked public and protected, but not private C) Constructors can only have a primitive return type

    D) Constructors are not inherited

9. How can you force garbage collection of an object?

    A. Garbage collection cannot be forced

    B. Call System.gc().

    C. Call System.gc(), passing in a reference to the object to be garbage collected. D. Call Runtime.gc().

    10; To most people, DHTML means a combination of: [Multiple Choices] (A).HTML 4.0

    (B). CSS

    (C). DHCP

    (D).JavaScript

    (E). AJAX

    11. The "setter()" and "getter()" methods of a class are about: (Multiple choices)

A. To access protected attributes

    B. To access un-protected attributes

    C. They are usually private methods

    D. They are usually public methods

    12. Which of the following statement is correct regard different modules in one program?

    (Multiple choices)

A. Different modules should be tightly coupled

    B. Different modules should be loosely coupled

    C. Classes in a single module should be tightly coupled

    D. Classes in a single module should be loosely coupled

13. Unified Modeling Language (UML) is:

A. A universal programming language

    B. To manage software requirement

    C. A platform and programming language independent collections of syntax and

    notation

    D. A collection of design patterns

14. Which of the following methodologies will help to create reusable design?

    (Multiple

    choices)

A. Design patterns

    B. Separate business logic and presentation

    C. Model-View-Controller (MVC)

    D. CMM

    15. Which of the following statement about "reference" is correct?

A. Reference is the alias of an object

    B. Reference and pointer is the same thing

    C. There is no reference in C++

    D. There is no reference in Java

    16. The "generics" support in C++ and Java 5 allows you to:

A. Avoid type cast error at compile time

    B. Avoid type cast error at load time

    C. Avoid type cast error at run time

    D. None of above

17. Which of the following statement is true about "static library"? (Multiple choices)

A. Windows ".dll" file is static library

    B. Windows ".lib" file is static library

    C. Linux ".so" file is static library

    D. Linux ".a" file is static library

18. 17. Which of the following is NOT the purpose of using object lazy load?

A. To speed up application loading

    B. To reduce memory usage

    C. To make the application "looks" fast

    D. To delay object loading until necessary

    19. 25. Which of the following is NOT a version control system?

A. BugZilla

    B. CVS

    C. Visual Source Safe

    D. ClearCase

    20. Which of the following diagram is not part of UML specification? A. Class diagram

    B. Sequence diagram

    C. Analysis diagram

    D. Deployment diagram

    21. Which of the following UML diagram is used to collect user requirement?

A. Collaboration diagram

    B. Use case diagram

    C. State diagram

    D. Activity diagram

22. "Build" is the process of compile, package and generate software binaries. Which

    of the

    following tools are for automatic "Build" purpose? (Multiple choices)

A. make

    B. junit

    C. Ant

    D. javac

    23. Which of the following items can run at browser client?

A.JavaScript

    B.PHP

    C.Java Applet

    D.Flash

    E.ASP

    F.Html

    G.JavaFX

    H.Silverlight

    Part Two: please write the correct answer for each question.

1. Which method will be invoked in the lifecycle of Servlet? Servlet contains many

    API for request processing including forward() and redirect(), whats the difference between forward and redirect?

     How many parameters do you know for optimizing JVM? 2.

    3. Please write description for following Linux commands. Eg: pwd Display current path..

    rm tail

    scp ls

    top grep

    free ps

    more tar:

    cat w:

Report this document

For any questions or suggestions please email
cust-service@docsford.com