Evaluating expressions

In this section, you will evaluate expressions from your Java code.

1.

Debug junit.samples.VectorTest.java to a breakpoint at line 26 (see the Debugging your Programs section for full details).
In the Display view in the Debug perspective, type the following line:

fFull.size()

Note: Instead of typing the full expression by hand you can use code assist to complete it.

2.

Select the text you just typed, and from its context menu, select Display (or the equivalent item in the Display view toolbar or Run menu).

Display view with fFull.size selected and showing context menu

3.

The expression is evaluated.

Display view showing evaluation result: (int) 0

4.

On a new line in the Display view, type the following line:

fFull.toArray()

5.

Select this line, and select Inspect from the Display view context menu (or the equivalent item in the toolbar or Run menu).

6.

The Expressions view opens with the value of the evaluated expression.

Expressions view containing fFull.toArray() expression