Course Material
|
TEST 1 MATERIAL
Conditionals and expressions
if statement, if-else
increment/decrement, arithmetic assignments
mixed expressions
type casting
abstraction & modularization
internal vs. external method calls
primitives vs. objects
Interaction and repetition
modular design
constant fields (final & static)
shared fields (static)
while loops
controlled by boolean expression, condition-driven
logical operators (&&, ||, !), remainder operator (%)
danger: infinite (black-hole) loops
variable scope
nesting loops & conditionals, cascading if-else
variables local to if/while block
for loops
used for counter-driven applications
equivalent to while loops
simulations: dice, dot race, volleyball
Class design and strings
highly cohesive
each class/method maps to a single entity/behavior
loosely coupled
classes are largely independent, interact via methods
strings
strings as objects
comparison using equals and compareTo
methods: length, charAt, substring, indexOf, toUpperCase, toLowerCase
Character static methods: isUpperCase, isLowerCase, isLetter, ...
StringUtils static methods: capitalize, reverse, stripSpaces, pigLatin, ...
|