I'm reading up Joshua Bloch's 'Effective Java' where in Item 2, he mentions the advantages of using Builder pattern when dealing with several parameters in the constructor. All's good, until I saw the multiple var-args difference between the conventional constructor and this pattern. So, I have some doubts regarding it :
- How does builder pattern allows for multiple var-args?
- Why does a conventional constructor allows for only a single var-arg? (Maybe due to the fact that it'll cause ambiguity in case there are multiple var-args, when the defined data type for both is same, but I'm not sure this is the correct reason behind it.)
I haven't used var-args in my code though, but yes I know their use. Still I'm unable to understand the reason behind above statements. Any help would be appreciated.