01. If a try statement has catch blocks for both Exception and IOException, then which of the following statements is correct?
a) The catch block for Exception must appear before the catch block for IOException.
b) The catch block for IOException must appear before the catch block for Exception.
c) The catch blocks for these two exception types can be declared in any order.
d) A try statement cannot be declared with these two catch block types because they are incompatible.
02. A method is declared to take three arguments. A program calls this method and passes only two arguments. What is the result?
a) Compilation fails.
b) The third argument is given the value null.
c) The third argument is given the value void.
d) The third argument is given the value zero.
e) The third argument is given the appropriate false value for its declared type.
f) An exception occurs when the method attempts to access the third argument.
03. Which of the following is a valid JavaBean method signature?
a) public void getArrow()
b) public void setBow()
c) public void setRange(int range)
d) public String addTarget(String target)
04. How do you force garbage collection to occur at a certain point?
a) Call System.forceGc()
b) Call System.gc()
c) Call System.requireGc()
d) None of the above
05. What is the value of that Number after the execution of the following code snippet?
long thatNumber = 5 >= 5 ? 1+2 : 1*1;
if(++thatNumber < 4)
thatNumber += 1;
d) The answer cannot be determined until runtime.
06. Which three are advantages of the Java exception mechanism?
a) Improves the program structure because the error handling code is separated from the normal program function
b) Provides a set of standard exceptions that covers all the possible errors
c) Improves the program structure because the programmer can choose where to handle exceptions
d) Improves the program structure because exceptions must be handled in the method in which they occurred
e) Allows the creation of new exceptions that are tailored to the particular program being created
07. When you’re organizing the elements in a class, which order is preferred?
a) Data members, methods, constructors
b) Data members, constructors, methods
c) Constructors, methods, data members
d) Constructors, data members, methods
e) Methods, constructors, data members
08. Which usage represents a valid way of compiling java source file with the name "Main"?
a) javac Main.java
b) java Main.class
c) java Main.java
d) javac Main
e) java Main
09. Which of these array declarations is not legal?
a) int scores = new int;
b) Object cubbies = new Object;
c) String beans = new beans;
d) java.util.Date dates = new java.util.Date;
e) int types = new int;
f) int java = new int;
10. "You have a list orders of PurchaseOrder objects, each with a date, a Customer and a state. You want filter list in various ways"
Which of the following in built functional interface you are going to use for above?