Skip to content

Latest commit

 

History

History
5 lines (3 loc) · 389 Bytes

7.47.md

File metadata and controls

5 lines (3 loc) · 389 Bytes

It should be explicit. Otherwise, code like item.combine("9-999-99999-9") will compile, but the code has no logical meaning.

Making the constructor explicit will stop compiler from automatically converting one type to the class type, which makes the code same as anticipation.

The drawback is we must call the constructor explicitly if we want to cover one type to the class type.