Questions
Answer the following questions to test your knowledge of this chapter:
- Which bytecode instruction is used to compare if two integers are equal and branch accordingly?
ifeq
if_icmpeq
if_acmpeq
tableswitch
- What does the bytecode instruction
ifeq
do?- Branches if the top value on the stack is equal to 0
- Branches if two integers on the stack are equal
- Jumps to a subroutine
- Loads an integer from an array
- Which bytecode instruction is used for unconditional branching?
goto
ifne
jsr_w
lookupswitch
- In Java bytecode, what does the
jsr
instruction do?- Jumps to a subroutine
- Calls a static method
- Compares two doubles
- Branches if the top value on the stack is null
- Which bytecode instruction is used to check if two object references are not equal and branches to the target instruction?
if_acmpeq
if_acmpne
ifnull
goto_w