Halaman

Tuesday, July 21, 2020

Section 9 Quiz Java Programming 2019 Learner - English

Section 9
(Answer all questions in this section)

To inspect bytecode, which option is used with the javap command to disassemble the class file?


-a


-b


-c (*)



-d



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


aload


iload (*)


iaload


iconst



opcode invokespecial is used to invoke an instance initialization method.


True (*)


False



Bytecode contains different opcodes for every type of loop written in source code.


True


False (*)



Bytecode is an intermediate representation of a program, somewhere between source code and machine code.


True (*)


False


Which of the following opcode instructions would add 2 integer variables?


add


+


addi


iadd (*)



The System or Application ClassLoader loads Java classes from the System Classpath. This classpath is set by the CLASSPATH environment variable.


True


False (*)



The Java developer can define a number of additional or custom classloaders.


True (*)


False



Which of the following exceptions is thrown by the loadClass() method of ClassLoader class?


IOException


SystemException


ClassFormatError


ClassNotFoundException (*)



The process of linking involves which of the following processes?


verification


preparation


resolution


All of the above (*)


In the ClassLoader hierarchy, which of the following is the only class loader that does NOT have a parent?


custom class loader


application class loader


bootstrap class loader (*)


extension class loader



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");
  }
}

(Choose all correct answers)


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. (*)



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


True


False (*)



Which of the following is NOT a java class loader?


verification class loader (*)


application class loader


bootstrap class loader


extension class loader



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


Extension Class Loader


Custom Class Loader


Bootstrap Class Loader (*)


Application Class Loader

No comments:

Post a Comment

Final Exam Java Programming 2019 Learner - English

Final Exam