Re: calling methods help

On 2005-08-10, Eric Sosman penned:
> a classB. (But the compiler isn't entirely trusting: if you
> happen to be wrong and `a' refers to a classZ instead, you'll
> get a ClassCastException at run-time.)

I think that happens because the compiler *is* entirely trusting.


Ask smart questions, get good answers:

Relevant Pages

  • Re: name binding from one template to another
    ... during the first step of compiler look-up, ... the definition of template, how could it bind (generate binary code ... generating any binary code, let alone linking. ... which previously declared entity a name refers to. ...
  • Re: Python 3K or Python 2.9?
    ... pointer/reference in their book on programming C++ or Java. ... refers to the current object inside that object's method. ... think knowing that the compiler is providing it is sufficient. ... I would mention that an instance is passed as the first parameter ...
  • Re: A small exercise
    ... {final int a; final int b; ... Main.this.b refers to the enclosing *instance* ... which would be illegal which is why the compiler complains. ... instantiated which means that you are trying to initialize a blank final ...
  • Re: Reversing a linked list
    ... The phrase "the implementation" refers to the compiler and standard ... If you are not the person who is responsible for implementing printf() ...
  • Re: Question about GC
    ... > the JVM inspects a stack frame, does it consider an object reachable ... > if a local variable currently refers to it, ... The argument I use is that I believe it's legal for the compiler to generate ...