Error: Main method not found in class Ex22.Define the main method as follows:
public static void main (String[]args)
Alternatively, the JavaFX application class must extend javafx.application.Application
It says, but I don't know why I'm making an error when I run it even though it's compiled.
The program is as follows:
public class Ex22{
public static void main() {
int[]moneyList={121902,8302,55100};
for(inti=0;i<moneyList.length;i++){
System.out.println(moneyList[i]);
}
for (intm:moneyList) {
System.out.println(m);
}
}
}
You must include String[]args as the main method argument.
If the project is a JavaFX application, you will need to extend the application class as warned.
"If the project is a normal Java project, you will need to specify the main method arguments as ""tokoi"" replied."
If you specify the IDE you are using, how you are trying to do it, and what you want to do, you will get a more specific answer.
© 2024 OneMinuteCode. All rights reserved.