15.07.2013 Views

jgrasp handbook

jgrasp handbook

jgrasp handbook

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DRAFT, February 18, 2003, Page 67<br />

Variable/Settiings pane, we now have an instance of Book called hemingway. Objects, represented by<br />

a colored square, can be opened and closed by clicking the “handle” in front of the square object.<br />

Primitives, like the integer pages, are represented by colored triangles. In Figure 51, hemingway has<br />

been opened to show the author, title, and pages fields. Each of the String instances (e.g., author) can<br />

be opened to view the individual characters. Notice that all the fields in hemingway are green, which<br />

indicates they were declared in the class Book.<br />

When an array is opened in the debugger, only the first ten elements (indexed 0 to 9) are displayed. To<br />

see other elements, left-click the array to select it, then click one more time. Note, this is not a doubleclick,<br />

but rather two single clicks. The first time you do this there may be a short delay, but a slider bar<br />

will popup that allows you to display a range of any ten items.<br />

After executing the next statement, Figure 52 shows an instance of the Fiction class called clancy that<br />

has been created. In the figure, clancy has been opened to reveal its fields. The field “mainCharacter” is<br />

green, indicating it is defined in Fiction. The other fields (author, title, and pages) are amber, which<br />

FIGURE 52. After next step and "clancy" created

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!