0

Constructor java

Is this correct (good practice etc.): Vechicle() { System.out.print("What color? "); this.color = scanner.nextLine; } instead of using arguments?

15th Jun 2018, 6:23 PM
Grzegorz Ryn
Grzegorz Ryn - avatar
1 Resposta
0
Better is data input separated from creating object. Arguments can be used for some few key parameters, or write method for set concrete parameter individually.
18th Aug 2024, 6:18 PM
zemiak