eclipse 的Debug过程
Debug模式是在eclipse的使用中非常常见的对程序进行debug的方式,通过debug模式我们可以更加方便快捷的定位问题出现的位置,并且找到原因进行修改.
public class hhh {
public static void main(String[] args) {
// TODO Auto-generated method stub
int a=8;
int num;
num =a;
System.out.print("The value is:"+'\n'+num/2+'\n');
System.out.print("The following is:\n"+
5*6+(6-2)+6+2);
}
}
1.设置断点
2.右键点击debug as,程序使用debug模式进行时会停在断点的所在位置
3.再点击按钮step into或者step over进行下一步的运行
4.一步步的进行调试即可找出程序的错误出现在哪。