Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

significance of public, static, void and main

 
Yasser Shaikh
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the significance of

public, static, void and main in

 
Stephan van Hulst
Bartender
Pie
Posts: 6503
83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have any guesses? If you don't, start reading this: http://download.oracle.com/javase/tutorial/java/index.html
 
Yasser Shaikh
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15632
46
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Yasser Shaikh
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 51390
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, it is the usual custom to writeIt is better style for the [] to follow "String", not "args".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic