From the course: IntelliJ IDEA Community Edition Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Inspect variable values

Inspect variable values

From the course: IntelliJ IDEA Community Edition Essential Training

Start my 1-month free trial

Inspect variable values

- [Instructor] When you suspend an application with a break point, you're able to inspect the values of variables, both simple values and complex objects. To demonstrate this, I'm going to get rid of this comment for this statement with empty body Lint condition. That's no longer true. And then above the for loop, I'm going to create an array list. I'll start it with a var keyword, and then I'll name the variable people. And I'll instantiate it with new ArrayList. Now for the diamond operator, I'll add in PersonObject, that's my current value object or data object, and then I'll auto-complete the statement with Command Shift Return on Mac or Control Shift Enter on Windows. Next within the for loop, instead of just outputting the value of i, I'll add a new object to that people array list. I'll call people.add, and then I'll call new PersonObject and I'll pass in values that have the current integer i appended.…

Contents