What does this mean:
Like what exactly does it do?Code:public static void main(String[] args) {
you can just give me a simple definition, not a scientific definition.
Printable View
What does this mean:
Like what exactly does it do?Code:public static void main(String[] args) {
you can just give me a simple definition, not a scientific definition.
I don't know.
Regards,
sukatoa
Check out my Website I explain it in depth. It in chapter 2 link
This is called the 'main method' and is the entry point to your program for the JVM.
Here is an extract from the Sun Java Tutorials:
Zebra, you really, REALLY need to check out the Sun Java Tutorials. They cover everything from the very beginning!! Everything you have been asking on these forums recently is covered in the tutorials in great depth with good examples that are easy to understand.Quote:
In the Java programming language, every application must contain a main method whose signature is:
The modifiers public and static can be written in either order (public static or static public), but the convention is to use public static as shown above. You can name the argument anything you want, but most programmers choose "args" or "argv".Code:public static void main(String[] args)
The main method is similar to the main function in C and C++; it's the entry point for your application and will subsequently invoke all the other methods required by your program.
The main method accepts a single argument: an array of elements of type String.
This array is the mechanism through which the runtime system passes information to your application. Each string in the array is called a command-line argument. Command-line arguments let users affect the operation of the application without recompiling it.Code:public static void main([B]String[] args[/B])
Please take a look: The Java™ Tutorials
Zosden, no offense but I found your description of this to be very vague.Quote:
Check out my Website I explain it in depth. It in chapter 2 link
I suggest you read what static actually means:Quote:
static - means that I can not copy it.
Q&A : What does the keyword 'static' mean?
I know you are not actually using this in your example but for an indepth explanation of the main method it would definitely be an advantage to explain fully what this means as it becomes quite useful.Quote:
String args[] - don't worry about this you won't need to do anything with this.
Thanks guys! Sorry I am a n00b. I will check out the tuts.
We've all gotta start somewhere bro!
You'll pick up Java in no time reading those tutorials trust me. I remember when I knew no Java what so ever. Those tutorials changed all that ;)