is it possible to get the value of a final variable declared outside an anonymous class (where the debugger currently is) in Eclipse? For example:
final int x = 5;
new Object() {
{
System.out.println(x);
}
};
This will compile and print “5”, but if I try to inspect x on the println line I get the error “x cannot be resolved to a variable”.
Expand the “this” item on Variables view; it contains variable val$x where you can see the x and it’s value.