Can't breakpoint the last statement of a code block in Eclipse

前端 未结 4 1730
甜味超标
甜味超标 2020-12-16 17:05
if (true) {
    String a = \"foo\";
    String b = \"bar\";
}

If I set a breakpoint at String a = \"foo\"; eclipse will stop, and I ca

4条回答
  •  青春惊慌失措
    2020-12-16 18:06

    If ending statement is assignment and it is on local variable why do you want to see its value because it will not be in scope anymore and can't effect.

    If it's setting same class attribute then you can see it when you return from this call and you have the object on which this method operated.

    Although this doesn't answer the question but I am trying to understand the use-case of your problem.

提交回复
热议问题