Introduction to Java
Java is a statically typed, object oriented language that compiles to bytecode and runs on a virtual machine, which is what makes it portable.
Syntax, variables, data types and control statements in Java.
9 notes
Java is a statically typed, object oriented language that compiles to bytecode and runs on a virtual machine, which is what makes it portable.
Install a JDK, understand every word in the classic first program, and learn what compilation and execution actually do.
Java has eight primitive types and everything else is a reference. Knowing which is which explains assignment, defaults and equality.
Widening happens by itself, narrowing needs a cast and can lose data, and casting a reference only changes how the compiler sees an object.
Java operators grouped by purpose, with the precedence rules, short circuit behaviour and integer arithmetic surprises that trip people up.
Reading from the keyboard and writing to the console, with the Scanner pitfall that catches almost every beginner.
The three comment forms, the reserved words you cannot use as names, and the naming conventions every Java codebase follows.
Decision making in Java, from the plain if statement to modern switch expressions and pattern matching.
Every looping construct in Java, when each one fits, and how break, continue and labels change the flow.