Java Programming Final Exam
Java Programming Final Exam
True or false?
_______________________
true
2. The java.io package has problems with no support for symbolic links.
True or false?
___________________
true
3. An absolute path always starts from the drive letter or mount point.
_______________
true
5. Which of the following files are not required to be uploaded to a web server to
deploy a JWS java application/applet?
_______________________
.java files
11. The Paths class provides a static get() method to find a valid Path.
True or false?
________________
true
13. File permissions are the same across all of the different operating systems.
__________________
false
18. You must explicitly close ResultSet and Statement objects once they are no
longer in use.
_________________________
true
19. Which of the following can fill in the //INSERT HERE correctly? (Choose Two)
22. JDBC has a type system that can control the conversion between Oracle database
types and Java types.
____________________________
true
23. Which of the following is the correct statement be inserted at //INSERT CODE
location that calls the database-stored procedure sayHello?
class Test{
public static void main(String[] args) {
try {
Connection conn = getConnection();
//INSERT CODE
cstat.setString(1, "Hello");
cstat.registerOutParameter(2, Types.NUMERIC);
cstat.setInt(2, 10);
}
catch(SQLException e){}
}
}
_________________________
CallableStatement cstat = con.prepareCall("{call sayHello(?, ?)}");
25. Java allows the same Java program to be executed on multiple operating systems.
_______________________________
true
27. During runtime, the Java platform loads classes dynamically as required.
_____________________________
true
28. Which of the following statements describe the Java programming language?
_______________________________
All of the above
29. Which of following statements describes Parallel and Serial Garbage collection?
________________________________
A Parallel garbage collector uses multiple threads to manage heap space.
31. Which of the following allows the programmer to destroy an object referenced by
x?
______________________________
Only the garbage collection system can destroy an object.
33. The bytecode for a Java method is located in which structure in the Java class
file?
_______________________________
method_info
Which of the following is the descriptor of the test method in the class file?
_________________________________
(Ljava/lang/String;I)V
37. Given the following information in the jdb tool, jdb paused at line 11:
9 public static void method1(){
10 x=100;
11 }
38. Which of the following commands can be used to monitor the Java Virtual Machine
statistics?
_________________________________
jstat
39. Before we can use the jsat tool we first have to use the jps tool to obtain JVM
process id numbers.
________________________________
true
40. Which of the following commands can be used to translate Java source code into
bytecode?
_____________________________
javac
41. Which of the following statements is NOT TRUE for the jdb command?
____________________________________
jdb can track the GC activity of the program.
42. The Java developer can define a number of additional or custom classloaders.
______________________________________
true
43. The same class cannot be loaded by the JVM more than one time.
____________________________
true
44. .class files are loaded into memory all at once, when a Java application is
launched.
__________________________
false
45. In the ClassLoader hierarchy, which of the following is the only class loader
that does NOT have a parent?
_____________________________
bootstrap class loader
48. Choose which opcode is used to push an int constant 5 onto the operand stack.
_____________________________
iconst_5