Computer Science 120
Introduction to Programming
Fall 2011, Siena College
Lecture 4: Working with Colors; Dragging Objects
Agenda
- Java naming conventions
- class names: capitalize, if made up from more than one word,
capitalize each word. e.g., TouchyWindow, FramedRect,
Color.
- instance variable and method names: lower case, if made up
from more than one word, capitalize all but the first word.
e.g., onMousePress, laundry, littleRedCircle.
- named constants: all caps, if made up from more than one
word, separate words by underscore characters. e.g.,
BALL_DIAMETER, VELOCITY, START_X.
- Working with colors
- custom colors
- random colors
- Dragging graphical objects
Suggested Exercise [not due for a grade]
- BDM Exercise 3.7.1, p. 78.
- BDM Exercise 4.2.2, p. 98.
Examples