Reputation: 89
sorry if this question was repeated earlier, but I couldnt seem to find the answer. I have a code:
import java.util.Scanner;
public class PracticeProblems {
public static void main(String[] args) {
int x;
Scanner input = new Scanner(System.in);
System.out.println("Enter a number: ");
x= input.nextInt();
if(x%2 == 0) {
System.out.println(x%2==0);
}
else {
System.out.println(x%2==0);
}
}
}
Now I am not too worried if the code actually works or not (because this same problem has occurred when the code was perfectly functional) I am just as confused why it doesnt run.
Upvotes: 1
Views: 2848
Reputation: 1
I have faced similar problems many times.
To solve this problem save the program, close Eclipse, reopen it and run the program without any loss of the program.
It works fine.
Upvotes: 0
Reputation: 306
I had a similar problems too.
Upvotes: 1
Reputation: 333
Try running by right clicking on PracticeProblems.java, and choosing "Run As Application". It looks like it is trying to run ComputeArea, and can't find that class.
Upvotes: 1