Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: Interface with implied Constructor Date: Fri, 26 Jul 2013 00:03:55 +0200 Lines: 31 Message-ID: References: <925adeb1-65b5-4a50-86a8-4f04784f8da0@googlegroups.com> <1KhGt.130731$7o1.74691@fx17.iad> <852ru8909m1p1eqcnhpotjpbmv1dd5hmui@4ax.com> <230720131443488398%jimsgibson@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net CCMBvNcLNgW7PJkfTM6jbgNNJ64Ni5TiS9xbJ2oLRrATibllY= Cancel-Lock: sha1:bcTBmSAWG9If3ZwoKwYXXPvkGmU= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 In-Reply-To: X-Antivirus: avast! (VPS 130725-1, 25.07.2013), Outbound message X-Antivirus-Status: Clean Xref: csiph.com comp.lang.java.programmer:24839 On 24.07.2013 23:20, Arved Sandstrom wrote: > Let's say that constructors are allowed in interfaces. There'd be no > problem in having multiple constructors in a single interface. The > requirement would be, as for other methods, that you define all of them > in an implementing class. Since constructors are unnamed (or put it differently: you have no choice) the likeliness of real conflicts seems higher to me than for ordinary methods in interfaces. (A conflict I am talking about is for example when two methods with identical argument list but different and incompatible exceptions exist. Ordinary methods would also have to share the name but the constructor declaration would probably use a specific keyword.) interface X { construct (int x, int y) throws FooBarException; } > I don't see this being practical. +1 Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/