Which component of a class initialises new objects when created with new…

2025

Which component of a class initialises new objects when created with new keyword in Java?

  1. A.

    Fields

  2. B.

    Constructors

  3. C.

    Methods

  4. D.

    Static blocks

Attempted by 57 students.

Show answer & explanation

Correct answer: B

In Java, constructors are special methods that initialize new objects when created with the new keyword. They set up initial state and ensure proper object creation before use.

Explore the full course: Rssb Senior Computer Instructor