Home > Back-end >  Create an array of class objects, there is no constructor available is what mean?
Create an array of class objects, there is no constructor available is what mean?

Time:12-01

CodePudding user response:

The Node needs to have a constructor, because the array will default calls the constructor,

CodePudding user response:

You realize the constructor, then the compiler will not give you provide a default constructor, so complains didn't find the default constructor

The solution has two:
1. Your own default constructor
2. The new object, according to your own constructor implementation initialized format

CodePudding user response:

Add a constructor with no parameters,
  • Related