Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-22-2008, 12:48 AM
AKP AKP is offline
Member
 
Join Date: May 2008
Posts: 3
Rep Power: 0
AKP is on a distinguished road
Default Basics
Can any one explain the following lines in java programming :

public static void main(String args[])

System.out.println(" ");
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 05-22-2008, 03:27 AM
Member
 
Join Date: Apr 2008
Posts: 23
Rep Power: 0
theonly is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-22-2008, 04:55 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,454
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
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.

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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-23-2008, 12:26 PM
Member
 
Join Date: May 2008
Posts: 17
Rep Power: 0
greyhat is on a distinguished road
Default
Quote:
public static void main(String args[])
This describes the main method and what the program actually does. the program runs from here
Quote:
System.out.println("")
This outputs a string on the screen.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 05-23-2008, 12:37 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,454
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Originally Posted by greyhat View Post
on the screen.
Actually to the console. Different OS has different consoles.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 05-23-2008, 12:49 PM
Member
 
Join Date: May 2008
Posts: 17
Rep Power: 0
greyhat is on a distinguished road
Default
ya sorry for that
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 05-23-2008, 12:53 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,454
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Just poinitng to the correct terminology my friend.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 05-23-2008, 01:06 PM
Member
 
Join Date: May 2008
Posts: 17
Rep Power: 0
greyhat is on a distinguished road
Default
ok thats fine with me
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

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

BB 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
Design Patterns - Basics (II) JavaForums Java Blogs 0 02-09-2008 11:26 PM
Design Patterns - Basics (I) JavaForums Java Blogs 0 02-09-2008 11:26 PM
regading jsp basics lpwing JavaServer Pages (JSP) and JSTL 0 01-21-2008 08:52 AM
Session Beans (basics) Java Tip Java Tips 0 12-28-2007 11:43 AM
Multithreading (basics) JavaForums Java Blogs 0 12-17-2007 01:21 PM


All times are GMT +2. The time now is 06:38 AM.



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