Re: overriding method with different return type

From: Chris Uppal (chris.uppal_at_metagnostic.REMOVE-THIS.org)
Date: 04/11/04


Date: Sun, 11 Apr 2004 08:29:05 +0100

Paul J. Lucas wrote:

> I want Base's param() to return a reference to Base.ParamBlock and
> Derived's param() to return a reference to Derived.ParamBlock.

That will be legal in 1.5 (you can try out the beta to confirm).

Be aware, however, that it is not implemented only by "relaxing" the rules of
the language (since the JVM doesn't support the change), but by making the Java
compiler automatically emit forwarding methods.

    -- chris



Relevant Pages

  • Re: overriding method with different return type
    ... > Paul J. Lucas wrote: ... >> Derived's param() to return a reference to Derived.ParamBlock. ...
    (comp.lang.java.programmer)
  • Re: ref params
    ... The REFERENCE was passed by value. ... my DataTable param var is populated. ... that it was passed by ref, ... in C#, in order to declare a parameter as ref, you need to declare it as ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Pass by reference or by value?
    ... param = 5 sets the local variable "param" to whatever 5 is. ... The local variable "param" doesn't *have* a type, and can be a reference to a value of any type. ... That hack makes sure that a method of the passed object is called instead of of the local namespace dict. ... (please note that I'm throwing around abstract concepts without caring about an implementation). ...
    (comp.lang.python)
  • Re: Object Parameters, they are passed as pointers, yes?
    ... > I saw the ref param keyword relating to base types. ... That param might be reference to an instance of a class or boxed valuetype. ...
    (microsoft.public.dotnet.languages.csharp)
  • Cannot reference page classes
    ... I'm using Beta 2, I haven't tried Beta 1 yet so I'm not sure if that's relevent. ... Why can't I reference my WebForm classes? ... For example I want to put a static method on a WebForm class so that I can pass an argument to it, however I can only reference certain classes in the ASP namespace. ...
    (microsoft.public.dotnet.framework.aspnet)