• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hi please Help Me!!

 
Amos Tham
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i am very new in java therefore i have a lot of questions to ask
what does public static void(String args[]) for?
 
Grishma Dube
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
public static void main(String args[])
It is a main method, which is a starting point of our program. public is a access specifier, which specifies that main method is accessible from any class. static specifies that we are not required to create instance of a class to invoke the main method. void is a return type, which indicates that main method does not return any value and it takes array of String as a parameter.
Hope this helps
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Amos Tham!
Following is a list of free on-line tutorials and books that you might find useful on your path to learning Java.
  • Sun's Java Tutorial
  • Introduction to Computer Science using Java by Bradley Kjell
  • Introduction to Programming Using Java by David J. Eck
  • Dick Baldwin's Java Programming Tutorials
  • Interactive Programming In Java by Lynn Andrea Stein
  • Bruce Eckel's Thinking In Java
  •  
    Dirk Schreckmann
    Sheriff
    Posts: 7023
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Note that Sun's Java Tutorial does a decent job of describing the main method as part of their Getting Started Trail.
    The main Method

    The entry point of every Java application is its main method. When you run an application with the Java interpreter, you specify the name of the class that you want to run. The interpreter invokes the main method defined within that class. The main method controls the flow of the program, allocates whatever resources are needed, and runs any other methods that provide the functionality for the application. The main Method tells you more.
     
    Amos Tham
    Greenhorn
    Posts: 3
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks Guys really a great help. really appreciated !!
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic