eclipse debug常见调试 F6 单步 F8完成 F5进入方法

eclipse debug常见调试  F6 单步 F8完成 F5进入方法


eclipse 里debug调试主要三个快捷方式 

F6 单步执行 执行到下一行代码

F8是执行完 假如后面还有断点 执行到下一个断点处

F5是进入方法里执行

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package  com.java1234.chap11;
 
public  class  Demo2 {
 
     private  static  int  add( int  a, int  b){
         int  c=a+b;
         return  c;
     }
     
     public  static  void  main(String[] args) {
         int  a= 1 ;
         int  b= 2 ;
         int  c=add(a,b);
         System.out.println(c);
     }
}


QQ鎴浘20170113161811.jpg


我们在 int a=1;前面打个断点 


然后debug运行程序

QQ鎴浘20170113161922.jpg


已经执行到这里了,我们F6 可以执行到下一行;

按下F6

QQ鎴浘20170113162046.jpg


我们继续F6


QQ鎴浘20170113162123.jpg


这里 有方法 假如我们需要debug进入add方法里 就需要F5 

按下F5

QQ鎴浘20170113162222.jpg


假如需要看变量运行时候的值 我们只需要鼠标移动上去即可

QQ鎴浘20170113162243.jpg


我们按F8 可以执行完程序(前提是后面没有断点了,否则执行到下一个断点处)

按下F8 执行完了

QQ鎴浘20170113162347.jpg

猜你喜欢

转载自blog.csdn.net/m_jack/article/details/80400902
今日推荐