Questions tagged [entry-point]
10 questions
57
votes
8 answers
Why a static main method in Java and C#, rather than a constructor?
I’m Looking for a definitive answer from a primary or secondary source for why (notably) Java and C# decided to have a static method as their entry point, rather than representing an application instance by an instance of an Application class (with…

Konrad Rudolph
- 13,059
- 4
- 55
- 75
24
votes
2 answers
Naming conventions for Java classes that have a static main method?
After reading gnat's answer to Why a static main method in Java and C#, rather than a constructor? I take his answer to mean that the purpose of a Java class with a static main method is to define a program entry point and that it is not meant to be…

Korey Hinton
- 2,656
- 3
- 20
- 30
20
votes
3 answers
Where did the convention of naming command line arguments as 'argv' come from?
It seems like Python, PHP, and Ruby all use the name "argv" to refer to the list of command line arguments. Where does the name "argv" come from? Why not something like "args"?
My guess is that it comes from C, where the v would stand for "vector".…

Mark Hildreth
- 333
- 2
- 9
10
votes
4 answers
What are the responsibilties of the main in object oriented programming?
I'm new to object oriented programming and I don't understand what's the purpose of the main.
Yes, I read that it's the "entry point" of the program but what I don't understand is what should be in the main? And what are its responsibilities?
It may…

Tripola
- 221
- 2
- 5
8
votes
7 answers
How do I dive deep into code that does not have a single entry point?
I work on enterprise Java projects that do not have a single entry point from where I can trace the flow of execution. Some of the projects have hundreds of classes, and when I'm asked to add a feature to a project, I often find myself at a loss as…

rdasxy
- 3,323
- 7
- 29
- 41
5
votes
1 answer
Which registers should executable loader install before start a program?
For example, I have simple C program that only have main function that just returns 0. What registers should loader (Linux exec loader, I guess) install before start a program? I didn't find information about this except stack pointer register.

YourJest
- 61
- 2
5
votes
1 answer
Where do you put the "main function" of a Python app?
Suppose you are developing a Python standalone application (not a library).
Would you make it a Python package? Or just files next to each other?
If you would make it a package, what would be the "starting point" file (where the first line of code…

Aviv Cohn
- 21,190
- 31
- 118
- 178
4
votes
3 answers
Why using string[] args in all main methods?
I'm a beginner in learning programming. I ask about using the string array in main method as a parameter. Why not writing the Main() method without the string array? What is the point of having this array in Main method?
For example:
public static…

Makeed
- 49
- 1
- 1
- 2
2
votes
1 answer
Main method templating
Now that I've gotten into a dependency injection groove, I find main methods for different applications all look basically the same. This is similar to stuff you might find on the Guice documentation, but I'll put an example here:
public class MyApp…

durron597
- 7,590
- 9
- 37
- 67
0
votes
1 answer
Starting Execution of Java Program
While reading about Java Programming I couldn't get why it states Java static main necessity reason is because "before you're program starts,there aren't any objects to send messages to" as said in slide 8 of static variables.
The reason why I…

justin
- 237
- 2
- 12