Ask Question
20 December, 01:40

This is a special function that is called whenever a new object is created and initialized with another object's data. destructor static function copy constructor assignment function None of these

+5
Answers (1)
  1. 20 December, 04:36
    0
    constructor

    Explanation:

    A constructor is a special method that initializes the fields of a class whenever a new object of that class is created with the new keyword. This method is called each time a new object is created.

    In the class definition, the constructor has the same name as the name of the class and does not contain a return type, not even void.

    A constructor looks like this

    public class Construct {

    String name;

    //Constructor

    Construct () {

    this. name = "ijeggs";

    }

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “This is a special function that is called whenever a new object is created and initialized with another object's data. destructor static ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers