•In basic algebra, variables are symbols that can represent values in formulas.
•For example the variable x in the formula f(x)=x2+2 can represent any number value.
•Similarly, variables in computer program are symbols for arbitrary data.
•For example the variable x in the formula f(x)=x2+2 can represent any number value.
•Similarly, variables in computer program are symbols for arbitrary data.
•Variables in Java have a type.
•The type defines what kinds of values a variable is allowed to store.
•Think of a variable’s type as the size or shape of the empty box.
•The variable x in f(x)=x2+2 is implicitly a number.
•If x is a symbol representing the word “Fish”, the formula doesn’t make sense.
0 comments:
Post a Comment