ok first off Javascript and Java are two COMPLETELY differents things.
second your code is very messed up, was it supposed to be a draft or something?
Here's a possible corrected code, put it in a CountsDownBy2.java file:
Code
import java.util.Scanner;
public class CountsDownBy2 {
public static void main(String[] args) {
int num = -1;
Scanner s = new Scanner(System.in);
while (num < 0) {
System.out.print("Enter a number: ");
num = s.nextInt();
}
while (num >= 0) {
System.out.println("Number: " + num);
num -= 2;
}
System.out.println("DONE");
}
}
This post was edited by m0hawk on Apr 28 2013 03:31pm