Anyone, why would we use initialize() instead of construcor().
package com.codegym.task.task05.task0511;
/*
Create a Dog class
*/
public class Dog {
//write your code here
String name;
int height;
String color;
//Dog dog1 = new Dog();
public void initialize(String name)
{
this.name = name;
this.height = 12;
this.color = "Black";
}
public void initialize(String name, int height)
{
this.name = name;
this.height = height;
this.color = "Black";
}
public static void main(String[] args) {
}
}