Ace Java 2026: Rock Your 'Thinking in Java' Challenge!

Question: 1 / 510

What Java feature allows for specifying the type in a class?

Inheritance

Generics

Generics is the correct answer as it allows for specifying the type in a class. Inheritance, polymorphism, and encapsulation are all fundamental concepts in Java, but they do not involve explicitly specifying the type in a class. Inheritance allows for one class to inherit properties and methods from a parent class, polymorphism allows for objects to take on different forms and behaviors, and encapsulation is the practice of hiding data within a class and only allowing access to it through methods.

Get further explanation with Examzify DeepDiveBeta

Polymorphism

Encapsulation

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy