[As três formas de cometar um código Java.] // msg (Só uma linha) /* msg */ (Todo o conteúdo, portanto, múltiplas linhas) /** msg-documentação */ (Todo conteúdo e permite a criação automática de documentação) [Palavras reservadas] abstract assert boolean break byte case catch char class continue default do double else enum extends false final finally float for if implements import instanceof int interface long native new null package private protected public return short static strictfp super switch synchronized this throw throws transient try true void volatile while [Tipos primitivos] char (16) byte (8) short (16) int (32) long (64) float (32) double (64) boolean (true or false) *Note: A boolean's representation is specific on each platform. [Operadores em ordem decrescente de prioridade] ++ unary postfix increment (right to left) -- unary postfix decrement ++ unary prefix increment (right to left) -- unary prefix decrement + unary plus - unary minus ! unary logical negation ~ unary bitwise complement (type) unary cast * multiplication (left to right) / division % remainder + addition or string concatenation (left to right) - subtraction << left shift (left to right) >> signed right shift >>> unsigned right shift < less than (left to right) <= less than or equal to > greater than >= greater than or equal to instanceof type comparison == is equal to (left to right) != is not equal to & bitwise AND (left to right) boolean logical AND ^ bitwise exclusive OR (left to right) boolean logical exclusive OR | bitwise inclusive OR (left to right) boolean logical inclusive OR && conditional AND (left to right) || conditional OR (left to right) ?: conditional (right to left) = assignment (right to left) += addition assignment -= subtraction assignment *= multiplication assignment /= division assignment %= remainder assignment &= bitwise AND assignment ^= bitwise exclusive OR assignment |= bitwise inclusive OR assignment <<= bitwise left shift assignment >>= bitwise signed-right-shift assignment >>>= bitwise unsigned-right-shift assignment