Debug調試

package com.itheima.demo05.Debug;
/*debug

Debug調試程序:
    可讓代碼逐行執行,查看代碼執行的過程,調試程序中出現的bug
使用方式:
    在行號的右邊,鼠標左鍵單擊,添加斷點(每一個方法的第一行,哪裏有bug添加到哪裏)
    右鍵,選擇Debug執行程序
    程序就會停留在添加的第一個斷點處
執行程序:
    f8:逐行執行程序
    f7:進入到方法中 進入方法後一步一步的執行,但不深刻
    alt+shift+f7 針對當前方法更加深刻一層
    shift+f8:跳出方法
    f9:跳到下一個斷點,若是沒有下一個斷點,那麼就結束程序
    ctrl+f2:退出debug模式,中止程序
    Console:切換到控制檯
    shift+f8跳出方法

*/
public class Demo01Debug {調試

public static void main(String[] args) {
    /*int a = 10;
    int b = 20;
    int sum = a + b;
    System.out.println(sum);*/

    /*for (int i = 0; i <3 ; i++) {
        System.out.println(i);
    }*/

    print();

}

private static void print() {
    System.out.println("HelloWorld");
    System.out.println("HelloWorld");
    System.out.println("HelloWorld");
    System.out.println("HelloWorld");
    System.out.println("HelloWorld");
}

}code

相關文章
相關標籤/搜索