In this example, we create a very simple problem : two integers of different domains, a and b, must satisfy the following equation : `a + b < 8`

` ````
import org.chocosolver.solver.Model;
import org.chocosolver.solver.variables.IntVar;
public class HelloWorld {
public static void main(String[] args) {
// The model is the main component of Choco Solver
Model model = new Model("Choco Solver Hello World");
// Integer variables
IntVar a = model.intVar("a", new int[]{4, 6, 8}); // takes value in { 4, 6, 8 }
IntVar b = model.intVar("b", 0, 2); // takes value in [0, 2]
// Add an arithmetic constraint between a and b
// BEWARE : do not forget to call post() to force this constraint to be satisfied
model.arithm(a, "+", b, "<", 8).post();
int i = 1;
// Computes all solutions : Solver.solve() returns true whenever a new feasible solution has been found
while (model.getSolver().solve()) {
System.out.println("Solution " + i++ + " found : " + a + ", " + b);
}
}
}
```

Choco Solver finds the following solutions :

` ````
Solution 1 found : a = 4, b = 0
Solution 2 found : a = 4, b = 1
Solution 3 found : a = 4, b = 2
Solution 4 found : a = 6, b = 0
Solution 5 found : a = 6, b = 1
```