为何总是在执行是提示:Exception in thread "main" java.lang.NoClassDefFoundError: Fruit
public class Fruit
{
public static void main(String args[])
{
// Declare and initialize three variables
int numOranges = 5; // Count of oranges
int numApples = 10; // Count of apples
int numFruit = 0; // Count of fruit
numFruit = numOranges + numApples; // Calculate the total fruit
// Display the result
System.out.println("A totally fruity program");
System.out.println("Total fruit is " + numFruit);
}
}
运行结果:
E:\dya>javac Fruit.java
E:\dya>java Fruit
Exception in thread "main" java.lang.NoClassDefFoundError: Fruit