Is including a constructor method necessary if it will be empty?

https://www.codecademy.com/courses/learn-java/projects/basic-calculator

I did everything in this project correctly, and it worked (as expected). But I commented out the constructor method to see if it would throw an error, and it didn’t. The output was the same as before. So when the constructor method is empty, is it still necessary to include it in your code?

No, it is not necessary to include an empty constructor (unless there are other non-empty constructors).

1 Like

That’s good to know, thank you!