Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Andreas Leitgeb Newsgroups: comp.lang.java.programmer Subject: Re: How to assign an object to another in it method? Date: Mon, 3 Jul 2017 14:04:00 -0000 (UTC) Organization: A noiseless patient Spider Lines: 11 Message-ID: References: <46334961-cc18-491f-828c-32e7401c7832@googlegroups.com> Reply-To: avl@logic.at Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 3 Jul 2017 14:04:00 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="d11154bb73ee01ffbd26915353679015"; logging-data="24360"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+lxXIZPWokuO5lAWo7Q/+g" User-Agent: slrn/1.0.2 (Linux) Cancel-Lock: sha1:oAjEGM/efQIOztGjKCi1OgBu7dw= Xref: csiph.com comp.lang.java.programmer:36796 Arne Vajhøj wrote: > That is what I consider the missing default parameter issue. > // **** NOT JAVA **** > public Demo(String name, int answer = 6, boolean prisoner = false) Imho this is one thing that Java actually got right, by *not* supporting. In C++, default values can give a hard time when overiding methods with defaults, as the default value depends on the static target object type even for virtual methods.