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.


How does C++ support concepts like interfaces and abstract classes compared to Java?

  1. Direct support through language keywords

  2. Only indirect support

  3. Through standard library functions

  4. Not supported at all

The correct answer is: Only indirect support

C++ supports interfaces and abstract classes through indirect support in the form of abstract base classes and pure virtual functions. While Java directly supports these concepts through language keywords, C++ can still achieve the same functionality through different means. These options may seem incorrect because they either state that C++ does not support these concepts at all (option D) or that it only supports them through a specific method (option A and C). However, B is the most accurate choice as it acknowledges the indirect support provided by C++ for interfaces and abstract classes.