+ 2
Make a program in java without main method
you have to code a program that has not a main method but prints or shows our calculation without any error...
4 Answers
+ 2
sumit singh đđ
+ 1
is that a CHALLENGE or a question
0
question
0
/*but it doesn't compile here in sololearn editor...
I have checked it in my PC which has jdk 10 installed*/
abstract class test extends javafx.application.Application{
static{
int a=9;
System.out.println("Hello world... without main");
System.out.println("square of "+a+" is: " +(a*a));
System.exit(0);
}
}
/*Check in your PC,in case of error please notify me*/