+ 1
Java
Why I need to write public static void main(String[]args)
3 RĂ©ponses
+ 4
You need to write this because this is the entry point of java.if you don't write your code never compile.the inventor of java create a java like this so it is necessary to write a main method.
+ 1
why we write import java.io.*;
+ 1
it's the entry level method in java...
For eg in C++ your code starts with main function like that in java we write public static void main ( String[] args ) function & we import packages ...with writing import keyword ...