Can anyone help me figure this out? I wrote the following code for my programming class.
package weekthreeassignments;
/**
*
* @author fred
*/
public class Odds {
public static void main(String[] args) {
int product = 1;
for (int i = 1; i <= 15; i++)
if (i % 2 == 1) {
product *= i;
}
System.out.println("Product of the odd integers from 1 to 15 is: " + product);
}
}
When I run the code I get the following error and how to fix it, but if you read the "Please define" part, I did define it that way. Why am I still erroring?
Error: Main method not found in class weekthreeassignments.Odds, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
C:\Users\fred\AppData\Local\NetBeans\Cache\10.0\ex ecutor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\fred\AppData\Local\NetBeans\Cache\10.0\ex ecutor-snippets\run.xml:68: Java returned: 1
BUILD FAILED (total time: 0 seconds)