0
Error In code
Why in this code output is No output but I coded it's to give output Test. https://code.sololearn.com/c115RETPd09n/?ref=app
8 ответов
+ 6
Vikash Godara first complete your full java then you are able to make java programs....
public class Program
{
public static void main(String[] args) {
System.out.print("Hello");
}
}
+ 5
Coder Kitten yup!! Without using main function the programs will not compiles...
I also tried to run in java N-IDE apk But that didn't work And i got the errors...
+ 4
Coder Kitten but visit this site,here shown we can execute java program without using main method and by using static block how?
But that code is not working on sololearn...
https://www.tutorialspoint.com/can-we-execute-a-java-program-without-a-main-method
+ 2
You need to have the main method
Without main
You may have n number of functions which won't show any ouput...
You need to add
Like
public static void main(String args[])
And then you may proceed to print
+ 1
Coder Kitten Why I can't change it?
Is main required for every code in java?