Can a class have parameters in Java?

A Java class constructor initializes instances (objects) of that class. Typically, the constructor initializes the fields of the object that need initialization. Java constructors can also take parameters , so fields can be initialized in the object at creation time.

Sizin İçin Seçtik  Elektrikli araba kendi kendini şarj eder mi?

Leave a Reply

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