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.


What keyword is used in Java to make a class member unable to be changed?

  1. Yes

  2. No

  3. Only if it's static

  4. Only in inner classes

The correct answer is: Yes

In Java, if a method is marked as final, it means that it cannot be overridden in any subclass. This is to prevent subclasses from changing the functionality or implementation of the final method. Therefore, the correct answer is A as all methods in a base class, including final methods, can be inherited by a derived class but they cannot be overridden. Incorrect answers include B, as stated previously, final methods cannot be overridden, and C and D, as the rules for overriding final methods also apply to static and inner classes, meaning they cannot be overridden either.