Java
Type Casting and Type Conversion in Java
Widening happens by itself, narrowing needs a cast and can lose data, and casting a reference only changes how the compiler sees an object.
Notes related to the Java language.
100 notes tagged
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 has eight primitive types and everything else is a reference. Knowing which is which explains assignment, defaults and equality.
Install a JDK, understand every word in the classic first program, and learn what compilation and execution actually do.
Java is a statically typed, object oriented language that compiles to bytecode and runs on a virtual machine, which is what makes it portable.