Is this example a bad coding style? Is it better to use other variable names in the constructor?
Class Myclass{ String name; String lastName; Myclass(String name, String lastName){ this.name = name; this.lastName = lastName; } } Is this example a bad coding style? Is it better to use other variable names in the constructor?
Class Myclass{ String name; String lastName; Myclass(String name, String lastName){ this.name = name; this.lastName = lastName; } } Source: https://ru.stackoverflow.com/questions/785654/
All Articles
classis written with a small letter. In this example, you can change the class nameMyclass, the access modifier for the constructor and the fields. Addingfinalpossible, but it already depends on context - Artem Konovalov