Halaman

Tuesday, July 21, 2020

Section 8 Quiz Java Programming 2019 Learner - English

Section 8
(Answer all questions in this section)

HotSpot has an HSDIS plugin to allow disassembly of code.


True (*)


False




The jsat tool can be used to monitor garbage collection information.


True (*)


False


Which of the following statements is NOT TRUE for the jdb command?


jdb can display the source code.


jdb can set the break pont for the program.


jdb can dump the stack of the current thread.


jdb can track the GC activity of the program. (*)



Which of the following commands can be used to monitor the Java Virtual Machine statistics?


jstat (*)


javap


javac


jmap


The javac command can be used to display native code in Java


True


False (*)

Before we can use the jsat tool we first have to use the jps tool to obtain JVM process id numbers.


True (*)


False


Which of the following commands allows a developer to see the effects of a running java application on memory and CPU?


javac


jvisualvm (*)


java


javap


Which of the following commands is used to launch a java program?


javac


jvisualvm


java (*)


javap


Which of the following commands can be used to translate Java source code into bytecode?


java


javac (*)


jdb


jstat


The attributes_count item indicates how many attributes are contained within a method.


True (*)


False


Which of the following structures are contained in a Java class file?


minor_version


major_version


access_flags


All of the above (*)



The class file contains the definition it inherits from the superclass.


True


False (*)



Given the following class structure:
public class Shape{
  void foo(){}
}
public class Circle extends Shape{
  void draw(){}
}
Which of the following statements is TRUE?


The foo method definition appears in the Circle class.


The Circle class contains both the foo and draw method definitions.


The foo method definition is only contained in the Shape class. (*)


If a Circle object is instantiated, the constructor of Circle will call the constructor of Shape.



Given the following declaration of the method test:
public static void test(String s, int i);

Which of the following is the descriptor of the test method in the class file?


(java/lang/String;int)V


(Ljava/lang/String;I)V (*)


V(Ljava/lang/String;I)


(Ljava/lang/String;java.lang.Integer)V



Which structure in the Java class file contains the line number information for the original source file?


method_info (*)


this_class


filed_info


cp_info

4 comments:

Final Exam Java Programming 2019 Learner - English

Final Exam