Mastering Java 2025 – 400 Free Practice Questions to Pass the 'Thinking in Java' Exam

Question: 1 / 510

What combines wrapping data and methods within classes and implementation hiding?

Inheritance

Polymorphism

Encapsulation

Encapsulation is the correct answer because it combines the concepts of data and methods within classes and also hides the implementation details from other parts of the code. Inheritance (A) may involve data and methods within classes but does not necessarily involve implementation hiding. Polymorphism (B) is a way of making code more flexible but does not necessarily involve wrapping data and methods within classes. Abstract Classes (D) may include data and methods within classes but do not necessarily hide implementation details. Therefore, the correct answer is C.

Get further explanation with Examzify DeepDiveBeta

Abstract Classes

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy