Java SE 8 Programmer I Exam: Object-Oriented Features

Object-Oriented Features of Java Language

Question

Which three statements describe the object-oriented features of the Java language?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E. F.

BCF.

http://www.javaworld.com/article/2075459/java-platform/java-101--object-oriented-language-basics--part-5--object-and-its-methods.html

The correct answers are B, C, and E.

A. Incorrect. Objects can be reused in Java through inheritance, composition, and other mechanisms.

B. Correct. Inheritance is one of the fundamental features of object-oriented programming, and it allows a subclass to inherit properties and behaviors from a superclass.

C. Correct. Object-oriented programming promotes code reusability, and one way this is achieved is by allowing objects to share behaviors with other objects. This is often achieved through the use of interfaces and abstract classes in Java.

D. Incorrect. A package can contain one or more classes.

E. Correct. In Java, the Object class is the root class of all other classes and provides a default implementation of methods such as equals(), hashCode(), and toString().

F. Incorrect. A main method is not required in every class in Java. It is only required in the class that is the entry point for the program, which is typically the class containing the main() method.