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

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

Prepare for your Java exam with our ultimate quiz based on 'Thinking in Java'. Engage with expertly crafted questions that enhance your learning process. Perfect for Java enthusiasts looking to solidify their knowledge!

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 to define a completely abstract class in Java?

  1. abstract

  2. interface

  3. virtual

  4. AbstractClass

The correct answer is: interface

An abstract class in Java is a class that cannot be instantiated and is used mainly for inheritance. It is used to provide a template for its subclasses to implement or override its abstract methods. Option A, "abstract" is a keyword that is used to define both an abstract class and abstract methods within a class. Option C, "virtual" is not a keyword in Java and is used in some other programming languages. Option D, "AbstractClass" is not a keyword in Java and does not follow the naming convention for classes. Therefore, B is the only correct option.