Possible Duplicate:
Difference between getAttribute() and getParameter()
I read parameter and attributes as two different topics in j2ee. But I am not able to realize the difference. Can any one clarify?
An attribute is a variable of any type that is declared directly in a class. A parameter is a variable defined by the function that receives a value when it is called. An attribute is used with classes and objects. A parameter is used with a function or a method.
The values that are declared within a function when the function is called are known as an argument. Whereas, the variables that are defined when the function is declared are known as a parameter.
Parameter is the variable in the declaration of the function. Argument is the actual value of this variable that gets passed to the function.
Note the difference between parameters and arguments: Function parameters are the names listed in the function's definition. Function arguments are the real values passed to the function. Parameters are initialized to the values of the arguments supplied.
Objects have attributes which basically is ,their data members. The operations defined on an object which are called as method in JAVA, have parameters in their parantheses, on these parameters the functions operate upon .
Parameters come from the client request. Example: http://google.com?q=1
Here q is a parameter.
Attributes are set by the server side. For example, you can set a session or request attribute called userId to indicate the current user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With