There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Robin Kumar wrote:I am currently done with the first three chapters of the book but i have come across three to four instances where its very confusing to differentiate what exactly is a an argument or a parameter.... kindly read page number 41(1st two lines),46(Definition of argument and parameter) & 249(1st two lines) of the book and please explain what the authors intended to say??
OCAJP 7, OCPJP 7
Nick Widelec wrote:
Robin Kumar wrote:I am currently done with the first three chapters of the book but i have come across three to four instances where its very confusing to differentiate what exactly is a an argument or a parameter.... kindly read page number 41(1st two lines),46(Definition of argument and parameter) & 249(1st two lines) of the book and please explain what the authors intended to say??
Ehy Robin,
Parameters: When you declare a method, like for example:
Arguments: When you call a method, following the previous example it would be:
Hope it cleared up things,
have a nice preparation for the exam!
Robin Kumar wrote:
Nick Widelec wrote:
Robin Kumar wrote:I am currently done with the first three chapters of the book but i have come across three to four instances where its very confusing to differentiate what exactly is a an argument or a parameter.... kindly read page number 41(1st two lines),46(Definition of argument and parameter) & 249(1st two lines) of the book and please explain what the authors intended to say??
Ehy Robin,
Parameters: When you declare a method, like for example:
Arguments: When you call a method, following the previous example it would be:
Hope it cleared up things,
have a nice preparation for the exam!
thanks for your effort but the book says the opposite in many places... kindly refer the pages i have mentioned and explain whether its an error or is there something that i'm not able to understand?
These two terms parameter and argument are sometimes loosely used interchangeably, and the context is used to distinguish the meaning. The term parameter (sometimes called formal parameter) is often used to refer to the variable as found in the function definition, while argument (sometimes called actual parameter) refers to the actual value passed. To avoid confusion, it is common to view a parameter as a variable, and an argument as a value.
OCAJP 7, OCPJP 7
The formal parameters of a method or constructor, if any, are specified by a list of comma-separated parameter specifiers. Each parameter specifier consists of a type (optionally preceded by the final modifier and/or one or more annotations) and an identifier (optionally followed by brackets) that specifies the name of the parameter.
A method invocation expression is used to invoke a class or instance method.
MethodInvocation:
MethodName ( ArgumentListopt )
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |