Home » Java » java – In Eclipse, Variables does not show child variables of extended class-Exceptionshub

java – In Eclipse, Variables does not show child variables of extended class-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

I have a class:

class MyArrayList extends ArrayList {
    public int dog;
    public MyArrayList(int v) {dog = v;}
}

I then create one:

foo = new MyArrayList(23);
System.out.println("foo.dog is"+foo.dog);

I put a breakpoint at the ‘System.out.println’ line. When I hit that breakpoint I look at the ‘Variables’ pane. There will be line for ‘foo’ with content assist available, BUT… there is no line which will show the value of foo.dog. How can I examine the value of foo.dog in the Variables pane?

How to&Answers:

Sorry. I got impatient. There is a button called ‘show logical structure’ (a yellow arrow pointing to a structure). Click it to see the locals.