0% found this document useful (0 votes)
29 views5 pages

Quiz 9

Quiz_9.docx

Uploaded by

miguel polanco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views5 pages

Quiz 9

Quiz_9.docx

Uploaded by

miguel polanco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

Choose which opcode is used to push an int constant 5 onto the operand
stack.
Mark for Review

(1) Points
iconst_5 (*)
idc5
iload_5
iaload_5
iinc5
Correct

2. Choose which opcode is used to load an int from the local variable to the
operand stack.
Mark for Review

(1) Points
aload
iload (*)
iaload
iconst
Correct

3. Bytecode is an intermediate representation of a program, somewhere


between source code and machine code.
Mark for Review

(1) Points
True (*)
False
Correct

4. Which of the following is NOT TRUE about Java?


Mark for Review

(1) Points
The JVM offers a secure environment to run a Java application
Bytecode is not portable, and needs to be compiled again in order to run on
a different platform. (*)

This study source was downloaded by 100000770888135 from CourseHero.com on 11-26-2024 17:10:52 GMT -06:00

https://www.coursehero.com/file/89525277/Quiz-9docx/
The JVM can interpret bytecode.
Once Java source code is compiled, it converts to bytecode.
Correct

5. opcode invokespecial is used to invoke an instance initialization method.


Mark for Review

(1) Points
True (*)
False
Correct
6. Which of the following opcode instructions would add 2 integer variables?
Mark for Review

(1) Points
add
+
addi
iadd (*)
Incorrect. Refer to Section 9 Lesson 1.

7. In the ClassLoader hierarchy, which of the following is the only class loader
that does NOT have a parent?
Mark for Review

(1) Points
custom class loader
application class loader
bootstrap class loader (*)
extension class loader
Correct

8. Which of the following from ClassLoader will load the rt.jar, the Java core
clsses which are present in the java.* package?
Mark for Review

(1) Points
Extension Class Loader

This study source was downloaded by 100000770888135 from CourseHero.com on 11-26-2024 17:10:52 GMT -06:00

https://www.coursehero.com/file/89525277/Quiz-9docx/
Custom Class Loader
Bootstrap Class Loader (*)
Application Class Loader
Correct

9. Which of the following is NOT a java class loader?


Mark for Review

(1) Points
verification class loader (*)
application class loader
bootstrap class loader
extension class loader
Correct

10. Which of the following statements is NOT TRUE for the


Class.forName("HelloClass") method? (Choose three)

public class Foo{


public void test(){
Class.forName("HelloClass");
}
}

Mark for Review

(1) Points
The forName() method does not initialize the HelloClass. (*)
The forName() method returns the Class object associated with the
HelloClass.
The forName() method does not load the HelloClas class into the Java
Runtime. (*)
In this example, the Class.forName("HelloClass") will use the ClassLoader
which loads the Foo class.
The forName method will instantiate a HelloClass object. (*)
Correct
Previous
11. The Java developer can define a number of additional or custom
classloaders.

This study source was downloaded by 100000770888135 from CourseHero.com on 11-26-2024 17:10:52 GMT -06:00

https://www.coursehero.com/file/89525277/Quiz-9docx/
Mark for Review

(1) Points
True (*)
False
Correct

12. .class files are loaded into memory all at once, when a Java application is
launched.
Mark for Review

(1) Points
True
False (*)
Correct

13. The process of linking involves which of the following processes?


Mark for Review

(1) Points
verification
preparation
resolution
All of the above (*)
Correct

14. The same class cannot be loaded by the JVM more than one time.
Mark for Review

(1) Points
True (*)
False
Correct

15. Which of the following exceptions is thrown by the loadClass() method of


ClassLoader class?
Mark for Review

(1) Points

This study source was downloaded by 100000770888135 from CourseHero.com on 11-26-2024 17:10:52 GMT -06:00

https://www.coursehero.com/file/89525277/Quiz-9docx/
IOException
SystemException
ClassFormatError
ClassNotFoundException (*)
Correct
Previous

This study source was downloaded by 100000770888135 from CourseHero.com on 11-26-2024 17:10:52 GMT -06:00

https://www.coursehero.com/file/89525277/Quiz-9docx/
Powered by TCPDF (www.tcpdf.org)

You might also like