Hints About CAPs In Java

www-bhc-edu
Lon Hosford
This week you learn that Java is a case exact language. As you proceed this week you may notice that language words and the Java API (Application Programming Interface) seem to follow a capitalization style.
First character name that are capitalized:
Class names. Ex: String and Hello.
Constants. (not covered this week) Ex: PAGEWIDTH
First character name that are not capitalized:
Method names. Ex: main
Variable names. Ex: price and cost
Package name. (using but not making covered in this course) Ex: java.awt.*
Java statments. Ex: if for. See page 9 of text.
Constants are capitalized:
PAGEWIDTH or PAGEHEIGHT
Embedded words in names are capitalized:
class HelloWorldDude
int myFirstName
int inventoryAverageTotal
This is sometimes called camel caps as in the humps of a camel.
Do you have to capitalize in the manner when you are charged to create a name? No, however following this style makes your code consistent to what most Java programmers do.
An advantage of following this plan is to quickly distinguish class, method and variables in code. Upper case first character only means class name. Lower case means variable or method and a method has parenthesis to distinguish it from a variable.