Java Vocabulary: General Idea
Java programs are built by combining a small set of language pieces with names we create.
Big picture
Data types
Operators
A programming language has vocabulary, just like a
spoken language. In Java, the vocabulary includes
data types, operators, comparisons, punctuation,
control-flow words, classes, and common methods.
`int`, `double`, `char`,
`String`, `boolean`
`+`, `-`, `*`, `/`,
`%`, `++`, `--`
Comparisons and logic
Control flow
`<`, `>=`, `==`, `!=`,
`&&`, `||`, `!`
`if`, `else`, `for`,
`while`
Objects and classes
Useful methods
`class`, `public`,
`private`, `new`, `static`
`System.out.println()`,
`Math.sqrt()`
vocabulary pieces → statements →
methods/classes → programs
Names such as variable names, method names, and class
names are the part that we choose ourselves.
Example Java statement
if (score >= 90) { System.out.println("A"); }
This line uses control flow, comparison, punctuation, a system method, and a string.
Key idea: recognize the categories first; memorization comes with practice.