Types, Variables and Operators
- Static typing. Java is statically typed: every variable declares its type, and the compiler holds you to it.
- Primitives. Eight primitives: int, long, double, boolean and friends: hold raw values without object overhead.
- Operators. Arithmetic and comparison operators behave predictably, and integer division truncates: 7 / 2 is 3.
Conditions and Loops
- if and else. An if statement branches on a boolean: Java accepts nothing looser than a real boolean in the condition.
- Loops. Java offers for, while and the enhanced for-each loop: for (Order o : orders) walks a collection cleanly.
- switch. Modern switch is an expression with arrows and no fall-through: a value-producing branch, checked by the compiler.
Methods and Basic Programs
- Methods. A method declares its return type, name and typed parameters: the signature is the contract.
- Overloading. Overloading gives one method name several parameter lists: the compiler picks by argument types.
- static versus instance. A static member belongs to the class itself; an instance member needs an object to exist first.
Before and after this level
- Before: Start Here: Java and the JVM: Source, Bytecode and JVM, How Java Applications Execute.
- Next: Level 2: Classes & Objects: Classes and Instances, Encapsulation and Constructors, Composition and Inheritance.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Java Level 1: Java Foundations cover?
Types, Variables and Operators, Conditions and Loops, Methods and Basic Programs: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Start Here: Java and the JVM, which covers Source, Bytecode and JVM, How Java Applications Execute.