• Post Reply Bookmark Topic Watch Topic
  • New Topic

Very beginning questions: parameter and parameter passing  RSS feed

 
Selecta Zhangy
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1, what is parameter?

2, what is "value passed as a parameter" ?

can someone explain brifely to me coz im confused? and please use one or more example.

thanks a lot!
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is parameter?

Read any programming language book (for C or C++ or VB or Java or ... in any natural language, such as English, Chinese, etc), you can find out your own answer in minutes!!!
 
Vanessa Astle
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There'll probably some criticisms about how I'm explaining this but:

A parameter is the information that a method needs in order for it to run.

For example:

public int convertToCelsius(int f) <<(parameter!!)
{
int c = (((f - 32)/9)*5);
return c;
}

Then when you call this method somewhere else, you pass it an arguement (parameter value)...

convertToCelsius(25);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!