Java OCA OCP Practice Question 119

Question

Which statement about the JVM is true?

  • A. The JVM schedules garbage collection on a predictable schedule.
  • B. The JVM ensures that the application will always terminate.
  • C. The JVM requires a properly defined entry point method to execute the application.
  • D. A Java compiled code can be run on any computer.


C.

Note

Garbage collection can happen at any time while an application is running, especially if the available memory suddenly becomes low.

Option A is incorrect.

Option B is incorrect, since you can create a Java application with an infinite loop that never terminates.

Option D is incorrect because the computer must be able to run the JVM in order to execute a Java class.

Option C is the correct answer, as the JVM does require an entry point method to begin executing the application.




PreviousNext

Related