Mastering Java: The Ultimate Quiz for 'Thinking in Java'

Disable ads (and more) with a membership for a one time $2.99 payment

Dive into the depths of Java with our quiz based on "Thinking in Java, Fourth Edition" by Bruce Eckel. Test your knowledge, solidify concepts, and prepare for certification with challenging questions and insightful feedback.

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


How do applets typically run in a web browser?

  1. By downloading a copy of the JVM to run locally

  2. Inside a sandbox for security

  3. Using a special applet plug-in

  4. Through a Java compiler embedded in the browser

The correct answer is: Inside a sandbox for security

Applets typically run inside a sandbox within the web browser for security purposes. This means that they are isolated from other system resources and cannot access files or execute commands on the user's computer. Option A, downloading a copy of the JVM, is not the most efficient method as it would require the user to have the JVM installed on their computer. Option C, using a special applet plug-in, is now obsolete as many web browsers have discontinued support for Java applets. Option D, through a Java compiler embedded in the browser, is incorrect as the browser does not have a Java compiler. The Java compiler is used to convert source code into byte code, which is then executed in the JVM. Therefore, the correct and most common way for applets to run in a web browser is through a sandbox for security.