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 is true about static methods?

  1. They can't use this

  2. They can access instance methods directly

  3. They are only used in static classes

  4. They cannot be private

The correct answer is: They can't use this

Static methods do not require an instance of the class to be called, hence they cannot use `this` keyword to reference the current instance. This means that they cannot access any instance methods or variables directly. Option C is incorrect because static methods can also be used in non-static classes. Option D is incorrect because static methods can be private as well.