It's not a secret anymore!
The moose likes Java in General and the fly likes significance of  public, static, void and main Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "significance of  public, static, void and main" Watch "significance of  public, static, void and main" New topic
Author

significance of public, static, void and main

Yasser Shaikh
Greenhorn

Joined: Oct 01, 2008
Posts: 21
what is the significance of

public, static, void and main in


~~yr[:_:]s~~
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 4101
    
  19

Do you have any guesses? If you don't, start reading this: http://download.oracle.com/javase/tutorial/java/index.html


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
Yasser Shaikh
Greenhorn

Joined: Oct 01, 2008
Posts: 21
Stephan van Hulst wrote:Do you have any guesses? If you don't, start reading this: http://download.oracle.com/javase/tutorial/java/index.html


couldnt find the answer there ... please help i am a beginner!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15002
    
  27

Yasser, did you really look in the tutorials that Stephan pointed you to? Because you can easily find the answers in there. Here are some more specific links into the relevant tutorial pages:

public: Controlling Access to Members of a Class
static: Understanding Instance and Class Members
void: Returning a Value from a Method
main: A Closer Look at the "Hello World!" Application

If there's still something you don't understand, then please ask more questions here - but please be specific. It's hard to understand a generic "I don't understand it" question.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Yasser Shaikh
Greenhorn

Joined: Oct 01, 2008
Posts: 21
Jesper de Jong wrote:Yasser, did you really look in the tutorials that Stephan pointed you to? Because you can easily find the answers in there. Here are some more specific links into the relevant tutorial pages:

public: Controlling Access to Members of a Class
static: Understanding Instance and Class Members
void: Returning a Value from a Method
main: A Closer Look at the "Hello World!" Application

If there's still something you don't understand, then please ask more questions here - but please be specific. It's hard to understand a generic "I don't understand it" question.

ok I understood all of it now. thank you. now I want to ask is the String var[] in the main method is it compulsary??
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
Yasser Shaikh wrote:is the String var[] in the main method is it compulsary?

What happens if you leave it out? Can you compile it? Can you run it?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 44588
    
  34
By the way, it is the usual custom to writeIt is better style for the [] to follow "String", not "args".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: significance of public, static, void and main
 
It's not a secret anymore!