Can a default constructor be empty?

Providing an empty default constructor( private ) is necessary in those cases when you don’t want an object of the class in the whole program . For e.g. the class given below will have a compiler generated default empty constructor as a public member . As a result, you can make an object of such a class.

Sizin İçin Seçtik  Hibrit araba az yakar mı?

Leave a Reply

Your email address will not be published. Required fields are marked *