Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-30-2008, 03:16 PM
Zebra's Avatar
Member
 
Join Date: Apr 2008
Location: Louisville, Indiana/Kentucky
Posts: 64
Zebra is on a distinguished road
What does this mean (Very Easy)
What does this mean:
Code:
public static void main(String[] args) {
Like what exactly does it do?

you can just give me a simple definition, not a scientific definition.
__________________
I am a Java n00b.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-30-2008, 04:10 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 526
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
I don't know.

Regards,
sukatoa
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-30-2008, 05:02 PM
Zosden's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 386
Zosden is on a distinguished road
Check out my Website I explain it in depth. It in chapter 2 link
__________________
My IP address is 127.0.0.1
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-30-2008, 05:50 PM
DonCash's Avatar
Moderator
 
Join Date: Aug 2007
Location: London, UK
Posts: 239
DonCash will become famous soon enoughDonCash will become famous soon enough
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:

Quote:
In the Java programming language, every application must contain a main method whose signature is:

Code:
public static void main(String[] args)
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".

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.

Code:
public static void main(String[] args)
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.
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.

Please take a look: The Java™ Tutorials
__________________
Did this post help you? Please
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
me!

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by DonCash : 04-30-2008 at 05:59 PM.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 04-30-2008, 05:56 PM
DonCash's Avatar
Moderator
 
Join Date: Aug 2007
Location: London, UK
Posts: 239
DonCash will become famous soon enoughDonCash will become famous soon enough
Quote:
Check out my Website I explain it in depth. It in chapter 2 link
Zosden, no offense but I found your description of this to be very vague.

Quote:
static - means that I can not copy it.
I suggest you read what static actually means:
Q&A : What does the keyword 'static' mean?

Quote:
String args[] - don't worry about this you won't need to do anything with this.
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.
__________________
Did this post help you? Please
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
me!

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by DonCash : 04-30-2008 at 06:01 PM.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 05-01-2008, 02:45 PM
Zebra's Avatar
Member
 
Join Date: Apr 2008
Location: Louisville, Indiana/Kentucky
Posts: 64
Zebra is on a distinguished road
Thanks guys! Sorry I am a n00b. I will check out the tuts.
__________________
I am a Java n00b.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 05-01-2008, 02:46 PM
DonCash's Avatar
Moderator
 
Join Date: Aug 2007
Location: London, UK
Posts: 239
DonCash will become famous soon enoughDonCash will become famous soon enough
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
__________________
Did this post help you? Please
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
me!

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Noob question- easy mattonitto New To Java 7 06-13-2008 01:26 AM
[SOLVED] Arrays/for-loops (easy) need help. Zebra New To Java 7 04-24-2008 05:03 AM
help me with a realy easy program (substring) michcio New To Java 7 01-27-2008 01:41 AM
Easy question JavaNoob New To Java 10 08-03-2007 11:28 PM
easy way to study the java springs concept kumar84 New To Java 1 07-17-2007 04:53 PM


All times are GMT +3. The time now is 02:30 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org