Posted on 16th September 2024|136 views
Recently, I started learning Java programming language. I got a learning guide from the library. While I’m working on the example programs, I found that in all example the ‘public static void main’ comes before any method is being used or created. What does it mean?
Posted on 16th September 2024| views
Hey Dikshit,
The function public static void main is a point from where the program begins its execution or entry the point of Java program is the main() method. Hence, it is an important core method in Java program and it can not return values and accepts parameters for complex command-line processing.
Syntax:
class Mindmajix {
public static void main(String[] args)
{
System.out.printIn(“I am Keerthana”);
}
}
Here, public means the method is visible and can be called from other objects, static means the method is associated with the class, not a specific object of the class, the void is the keyword and used to specify that a method doesn’t return anything, and main is the name of the Java main() method.