Results 1 to 8 of 8

Thread: Basics

  1. #1
    AKP
    AKP is offline Member
    Join Date
    May 2008
    Posts
    3
    Rep Power
    0

    Default Basics

    Can any one explain the following lines in java programming :

    public static void main(String args[])

    System.out.println(" ");

  2. #2
    theonly is offline Member
    Join Date
    Apr 2008
    Posts
    23
    Rep Power
    0

    Default

    Ok

    public static void main(String args[]) = the beginning of the main body(front end) of your program.

    System.out.print(""); = prints whatever is in between " " to the screen

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Java Code:
    public static void main(String args[])
    This is the entry point of any Java class. We called it as main method. (A function defined in a Java class as method) Without a main method you can't run your Java class directly.

    Java Code:
    System.out.println(" ");
    Print a line of text(a string in Java) to the console and place the cursor on the next line. If you used print() it's not place the cursor on the next line.

  4. #4
    greyhat is offline Member
    Join Date
    May 2008
    Posts
    17
    Rep Power
    0

    Default

    public static void main(String args[])
    This describes the main method and what the program actually does. the program runs from here
    System.out.println("")
    This outputs a string on the screen.

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by greyhat View Post
    on the screen.
    Actually to the console. Different OS has different consoles.

  6. #6
    greyhat is offline Member
    Join Date
    May 2008
    Posts
    17
    Rep Power
    0

    Default

    ya sorry for that

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  8. #8
    greyhat is offline Member
    Join Date
    May 2008
    Posts
    17
    Rep Power
    0

Similar Threads

  1. regading jsp basics
    By lpwing in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 01-21-2008, 08:52 AM
  2. Session Beans (basics)
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-28-2007, 11:43 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
  •