Main() method in java - pre defined or user defined?

  • Context: Java 
  • Thread starter Thread starter anyonebutangel
  • Start date Start date
  • Tags Tags
    Java Method
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 1K views
anyonebutangel
Messages
40
Reaction score
5
TL;DR
should main() method in java be considered pre defined method or user defined?
although we cannot change the syntax of the main() method but programmer does create main() everytime in the program.so i want to ask if it should be pre defined method.
 
Physics news on Phys.org
anyonebutangel said:
Summary:: should main() method in java be considered pre defined method or user defined?

although we cannot change the syntax of the main() method but programmer does create main() everytime in the program.so i want to ask if it should be pre defined method.
The Java main() method is defined by the user, but its signature (i.e., its argument and return type) have to follow a set pattern.
 
Mark44 said:
The Java main() method is defined by the user, but its signature (i.e., its argument and return type) have to follow a set pattern.
So should it be pre defined?
 
anyonebutangel said:
So should it be pre defined?
The body of the main() method is not predefined -- it has to be written by the programmer for each program.
 
ok got it now