COMP SCI 302 Chapter Notes - Chapter 1: Style Guide, Computer Programming, Escape Sequence

42 views5 pages

Document Summary

Assignment statement : assigns the right-side item"s current value into the variable on left side. Assigns the value 8 to the variable numapples. Expression: may be an integer, a variable, or simple calculation involving variable and integer using standard math operators such as: left . Common error among programmers is to assume = means equals like math. = means compute value on right and assign computed value into variable on. Common error: beginning programmers write assignment statement in reverse -- will compile but will be a bug. Numitems = 5; numitems = numitems + 1; Value of numitems becomes 6, overwriting the previous variable value. Identifier: name created by a programmer for an item (such as a variable or a method) Must be a sequence of letters (a-z, a-z, _, $) and digits (0-9) Most java programmers do not use $ or _ in their identifiers. Reserved word/ keyword: part of the java language (like int, short, double)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents