+ 1

Is important the constructor in one program of java??

Constructor

7th Jul 2017, 9:02 PM
Luis Felipe De La Rosa Garcia
Luis Felipe De La Rosa Garcia - avatar
2 ответов
+ 4
Just keep in mind if you do not have a constructor the compiler will interpret it as you having an empty constructor. (This is a default constructor). So you don't actually have to create one manually for every class.
7th Jul 2017, 10:12 PM
Rrestoring faith
Rrestoring faith - avatar
+ 3
a constructor makes it possible that an object is created and that class variables can be initialised, so yes it is important
7th Jul 2017, 10:01 PM
‎ɐısıօլɐ
‎ɐısıօլɐ - avatar