| 1. |
Differentiate between variable/ function declaration and definition in the context of any OOPs programming language. |
||||||||
|
Answer» The purpose of a variable declaration is to tell the compiler of the following INFORMATION: the variable's name, the KIND of value it stores, and the initial value if any. Declaration, in other words, provides information about a variable's attributes. The definition of a variable allocates memory space for the variable and SPECIFIES where the variable will be stored. The following table illustrates the differences between definition and declaration:
|
|||||||||