Path: csiph.com!au2pb.net!2.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: method parameter binding Date: Thu, 10 Dec 2015 17:23:24 +0100 Organization: albasani.net Lines: 24 Message-ID: References: <6bfa4a78-934e-4f90-8e5f-a2f56e529842@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net /z6Nbh68htlR5Rq7XU3n21edJLvWL1JipqSTNG5LNU+EnsX/LbFVYw7Zxle5tWOsVWpkeFoRxM40fzzRcEMzu2vj3+Hj+BgSZTKmGHN89YNXrunpiXWPLEFvZyqeDjNC NNTP-Posting-Date: Thu, 10 Dec 2015 16:23:25 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="iWP5lOehGElac6g9Xnx/38LDQgtPXR2bKYxSXoMjeKBmQiek4lxDBxIQFJaY7sTDmZpYw6ZOWYcK1k/CjLr6AIeDKZCnuz+tfhsrDwqyx9AyBcyUWRiXQRZxXgEk0MBp"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 In-Reply-To: Cancel-Lock: sha1:23bD7Etn9Y+UkfX3R8L8WZcgRUc= Xref: csiph.com comp.lang.java.programmer:33332 Eric Douglas schrieb: > Class Two extends One { > Number get( Number x, Number y ) > { > throw new IllegalStateException("test"); > } > } If you override get( Double x, Double y ) or get( Long x, Long y ) you can also throw an exception there. For static methods, you can override like that, I mean you would write Two.get and not One.get, but this is not overriding, for static methods if you write One.get you get One.get. For dynamic methods if you write x.get and x is of type One, you might also get Two.get invoked. Bye