Hi,

the lab 1014, part 2.2 ("StaticMethodsExample.java") seems to contain
a bug in the code that shall demonstrate the compiler error which
results from trying to access a static method from an object instance.

This is the offending code line:
    // Compile error
    Methods.myNonStaticMethod(3);

This code line does actually result in an error, but not the "correct
error".
The screen shot in the lab document shows the following error message:
    cannot find symbol
    symbol : myNonStaticMethod(int)
    location : class Methods

The bug seems to be this: the method name is spelled wrongly.
The class Methods contains a non-static method named myNonStaticMethods
() -- with an "s" at the end of the name.

When I modify the lab code provided into the following:
    // Compile error
    Methods.myNonStaticMethods(3);

then I do get the "correct error", which is:
    non-static method myNonStaticMethods(int) cannot be referenced
from a static context

I believe this should be corrected in the lab document, both the
offending code line and the screen shot that shows the resulting
error. Do you agree?

(My apologies if this bug has been brought to attention earlier. I
tried to search for it, but could not find any posts on it.)


Regards,

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to