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

  • Thread starter Thread starter anyonebutangel
  • Start date Start date
  • Tags Tags
    Java Method
Click For Summary
The discussion centers on whether the main() method in Java should be classified as a predefined or user-defined method. While the syntax of the main() method is fixed and must adhere to a specific signature, the body of the method is created by the programmer for each program. This leads to the conclusion that the main() method is user-defined due to the necessity for programmers to implement its functionality, despite its rigid structure.
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.
 
Technology 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
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 0 ·
Replies
0
Views
627
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 3 ·
Replies
3
Views
6K
Replies
1
Views
2K
  • · Replies 0 ·
Replies
0
Views
1K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
3
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
3
Views
3K