Results 1 to 3 of 3

Thread: java structure

  1. #1
    PBHATT is offline Member
    Join Date
    Aug 2010
    Posts
    1
    Rep Power
    0

    Default java structure

    why main ( ) is a public, static method in a Java application programm ? ? ?

  2. #2
    masokis's Avatar
    masokis is offline Member
    Join Date
    Aug 2010
    Posts
    5
    Rep Power
    0

    Default

    it should be like this....
    Java Code:
    public static void main (String args[])
    h0pe this helping.........

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,411
    Rep Power
    25

    Default

    why main ( ) is a public, static method
    When you start executing a java application with the java command, java needs a specific static method in your code to call. The convention is that it will call the main(String[] ) method.

    Otherwise how would java know what to call and what args to pass?

Similar Threads

  1. Tree structure using JAVA
    By trill in forum Advanced Java
    Replies: 2
    Last Post: 05-27-2010, 11:02 AM
  2. Passing a structure from Java to C using JNI
    By vipin27 in forum New To Java
    Replies: 0
    Last Post: 02-23-2010, 06:22 AM
  3. How can I create Graph(Data structure) with Java
    By mir.shahidul in forum New To Java
    Replies: 4
    Last Post: 02-09-2009, 08:48 AM
  4. Stack data structure in Java
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-16-2008, 10:34 PM
  5. Java Array of Structure
    By PAffiliates in forum New To Java
    Replies: 1
    Last Post: 01-28-2008, 06:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •