Ask Question
27 September, 10:26

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. 27 September, 10:53
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers