Naming Convention
Naming Convention
•For
Class, method, namespace, and property identifiers
–First letter of each
word capitalized
•For
Variables and Objects
–First letter of
identifier lowercase; first letter of subsequent concatenated words capitalized
–First letter of
variable name indicates its data type (I –int, f
–float, d – double, b – boolean (not used
in text)
– For
Constant Literals
–All letters of
identifier in upper case
–Underscore between
words of identifier name
Variables
•Area
in computer memory where a value of a particular data type can be stored
–Declare a variable
–Allocate memory
•Syntax
– Simple Declaration
–type identifier; e.g.:
–double
dTotSales;
•Syntax
– Declaration &Compile-time initialization
–type identifier = expression; e.g.
–double
dTaxRate =
.125;
Comments
Post a Comment