public class JavaApplication48 {
public static String evens(int a){
String txt = "";
if (a < 0){
return "NONE!";
}
else if(a%2 == 1){
a -= 1;
}
for (int i = 0; i <= a; i+=2){
if (i < a){
txt += i+",";
}
else{
txt += i;
}
}
return txt;
}
public static void main(String[] args) {
System.out.println(evens(1));
}
}
I hope this helps!