Compiler Error: "class, Interface, Or Enum Expected"


Answer :

You miss the class declaration.



public class DerivativeQuiz{
public static void derivativeQuiz(String args[]){ ... }
}


Every method should be within a class. Your method derivativeQuiz is outside a class.



public class ClassName {

///your methods
}


You forgot your class declaration:



public class MyClass {
...


Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable