Advantages of Constructor Overloading

前端 未结 6 1849
青春惊慌失措
青春惊慌失措 2021-01-18 10:45

I am very new to Java and trying to learn the subject, having previous programming exposure in only HTML/CSS. I have started with Herbert Schildt and progressed through a fe

6条回答
  •  失恋的感觉
    2021-01-18 11:33

    When you are dealing with immutable classes and you want to provide multiple ways to instantiate them, then overloading the constructor is convenient.

提交回复
热议问题