I have been troubleshooting this program for hours, trying several configurations, and have had no luck. It has been written in java, and has 33 errors (lowered from 50 befo
You miss the class declaration.
public class DerivativeQuiz{
public static void derivativeQuiz(String args[]){ ... }
}
class, interface, or enum expected
The above error is even possible when import statement is miss spelled. A proper statement is "import com.company.HelloWorld;"
If by mistake while code writing/editing it is miss written like "t com.company.HelloWorld;"
compiler will show "class, interface, or enum expected"
You forgot your class declaration:
public class MyClass {
...
Every method should be within a class. Your method derivativeQuiz
is outside a class.
public class ClassName {
///your methods
}
Look at your function s definition. If you forget using "()" after function declaration somewhere, you ll get plenty of errors with the same format:
... ??: class, interface, or enum expected ...
And also you have forgot closing bracket after your class or function definition ends. But note that these missing bracket, is not the only reason for this type of error.
the main method should be declared in the your class like this :
public class derivativeQuiz_source{
// bunch of methods .....
public static void main(String args[])
{
// code
}
}