Actually, yes! This requires use of the OR operator, which will return true if at least one argument in a set is true. Here's what it would look like in your example:
for (int i = 1; i <= 10; i++) {
if (i == 1 | i == 3 | i == 5 | i == 7 | i == 8) {
System.out.print(i + "");
}
}
// --> 1 3 5 7 8