I was trying this piece of code but some how I just forgot to write (String [] args) in main() method
It compiled fine.
But
when tried it to execute it gave the error as follows:--
Error: Main method not found in class Test, please define the main method as
public static void main (String [] args)
or a javaFX application class must extend javafx.application.Application
class Test{
public static void main(){
int x = 0;
int y = 0;
while( x < 5 ) {
y = x-y;
System.out.println( x + "" + y + " ");
x = x+1;
}
}
}
javaFX application class must extend javafx.application.Application. I want to know about this stuff how and when to implement this
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Nouser
31 October 2020, 08:08
The signature of the main method is not correct. You need to write it exactly as in your lessons (with String[] args as parameter)
Edit: Cause you have changed your question... for the JavaFX part... you should first learn the Java basics. JavaFX is not that easy to understand as it requires techniques that you first will see in the multithreading course. So stay patient for a little bit longer ;)
0
Dinesh
31 October 2020, 13:26
Thanks for your fruitful suggestion
0