# Breakpoint Condition Option

Each breakpoint can have a unique condition that determines when the breakpoint will be hit.

A condition for a breakpoint can be any logical expression that evaluates to either true or false. The expression is evaluated in the scope of the breakpoint location, meaning you cannot make reference to a class, etc., outside the scope of the breakpoint location when composing your expression.

Consider the following example:

    public class Person {

    	String name = "";
    	int age = 0;

    	public Person(String name, int age) {
    		this.name = name;
    		this.age = age;		//breakpoint here
      }
    };

If we take the above example, place a breakpoint where indicated and go to the breakpoint properties we can add our condition. In this case we are limited only to the members of the class the breakpoint is contained in and those provided by Object.

For example a valid condition could be:

    	age == 56

meaning the breakpoint would only suspend when age was equal to 56.

Conditions can be added to breakpoints using the breakpoints properties dialog shown below.

Breakpoints

Adding breakpoints
Removing breakpoints
Launching a Java program
Running and debugging