Menu

Chapter 3: Help: Errors on Inspect & Evaluate

Rick_
2008-07-06
2013-04-09
  • Rick_

    Rick_ - 2008-07-06

    I have entered the code.
    I have done the import following the tutorial.
    I have created the objects using spelling/capitalization/naming as in the tutorial

    When I am in the scrapbook and I do a "p." I see the objects of "Person"
    When I INSPECT

    Person p = new Person();
    p.setName("Fred");
    p.setMaximumBooks(3);
    p

    I get

    The method setName(String) is undefined for the type Person
    The method setMaximumBooks(int) is undefined for the type Person

    When I EXECUTE I get

    The method setName(String) is undefined for the type Person
    The method setMaximumBooks(int) is undefined for the type Person

    When I type 'p.' the assist sees the objects, it seems that the runtime does not.

    Is there a way to check if my "Import" did not work?
    Any ideas where else to look.

    Great tutorials. I appreciate them.

    Rick_

     
    • Rick_

      Rick_ - 2008-07-06

      When a user creates a line of code with a syntax error, then does not move to the next line, the error does not always show. Then the user moves to the Scrapbook and clicks SAVE - the SAVE applies only to the current tab so the object on the other tab is not saved. Code that is not saved does not exist (undefined for the type Person).

      Step 1: Save on all tabs;
      Step 2: Inspect each tab for syntax errors and repair;
      Step 3: Go to your Scrap to work;

      Thanks for the wonderful tutorials. If only the style and content were an Internet requirement, the net would be a better place....

      Rick_

       

Log in to post a comment.