Understanding the building blocks and runtime environment.
A Java program is essentially a collection of objects talking to other objects by invoking each other's methods. Every object is of a certain type, defined by a class or an interface.
The JRE is the minimum requirement to run any Java application.
The "heart" of the Java platform, responsible for "Write Once, Run Anywhere".
.class) into machine-specific code.public class Dog → Dog.java).$), or Underscore (_).foo vs FOO).class, public).Standard practices for writing clean Java code.
PascalCase (Nouns)
Start with Uppercase. If multiple words, capitalize each inner word.
class BankAccount
PascalCase (Adjectives)
Same as Class, but names are typically adjectives.
interface Runnable
camelCase (Verb-Noun)
Start Lowercase. Inner words capitalized. Action oriented.
getBalance()
camelCase
Start Lowercase. Short and meaningful names.
int buttonWidth
UPPER_SNAKE_CASE
All uppercase. Underscores separate words. (static final).
MAX_HEIGHT
Encapsulation Standard
| Syntax | Description |
|---|---|
\t | Insert a tab |
\b | Insert a backspace |
\n | Insert a newline |
\r | Insert a carriage return |
\f | Insert a form feed |
\' | Insert a single quote |
\" | Insert a double quote |
\\ | Insert a backslash |