Use the shortcut idea to use (a) conditional breakpoints

Debugger, and an increase in circulation in the conditional, can greatly improve efficiency, but also joyful mood. The following describes the conditions under IDEA a breakpoint] [Condition
 
 1 , write a sample code 
 
 
/ ** 
 * @author jiashubing 
 * @Since 2017/11/13
  * / 
public  class the Test {
     public  static  void main (String [] args ) {
    int a = 1;
    int b = 10;
    int c = a+b;
    for (int i =0;i<c;i++){
    System.out.println("-");
    }
   } 
}

2 , in System.out.println ( "-"); a click on the left side of this sentence, a red dot appears, is the breakpoint 3, right-click the breakpoint, the following dialog box, in the Condition box input conditions i == 2

 

 4, run debug, break into the moment, that is, when i is equal to 2

 5, the shortcut keys see step 3 picture on [Ctrl + Shift + F8], after opening as shown, is to look at the details of all breakpoints dialog box (in addition to using keyboard shortcuts, it also can be directly in the Debug panel this flag click below the (two breakpoints sign))

 

Guess you like

Origin www.cnblogs.com/alomsc/p/11417253.html