How to use conditional breakpoint in Eclipse?
Put your breakpoint.Right-click the breakpoint image on the margin and choose Breakpoint Properties:
Configure condition as you see fit:
Make a normal breakpoint on the doIt(tablist[i]);
line
Right-click -> Properties
Check 'Conditional'
Enter tablist[i].equalsIgnoreCase("LEADDELEGATES")
1. Create a class
public class Test { public static void main(String[] args) { // TODO Auto-generated method stub String s[] = {"app","amm","abb","akk","all"}; doForAllTabs(s); } public static void doForAllTabs(String[] tablist){ for(int i = 0; i<tablist.length;i++){ System.out.println(tablist[i]); } }}
2. Right click on left side of System.out.println(tablist[i]); in Eclipse--> select Toggle Breakpoint
3. Right click on toggle point --> select Breakpoint properties
4. Check the Conditional Check Box --> write tablist[i].equalsIgnoreCase("amm") in text field --> Click on OK
5. Right click on class --> Debug As --> Java Application