All syntax guides
Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.
3,980 guides across 14 topics
Topics
Popular guides
Most readLatest guides
Page 311 of 398Java Bitwise Complement: How ~ Works
Java's bitwise complement operator (~) flips every bit in an integer. Because of two's complement, ~5 is -6 and ~x equals -x - 1. See how to use ~ for bit masking and clearing flags.
Java XOR Operator: Syntax and Practical Uses
Explains the Java XOR operator (^) for booleans and integers, with practical patterns for bit toggling, unique-element detection, and common pitfalls.
Using the Java Bitwise OR Operator
Learn how to use Java's bitwise OR operator to combine flags, set individual bits, and avoid signed-integer surprises.
Java Bitwise AND: Usage and Common Traps
Learn how the Java bitwise AND operator works on integer types, with practical masking examples and common pitfalls when mixing it with other operators.
Java Bitwise Operators: Working with Binary Data
Explore Java bitwise operators and how to use them for bitmasking, shifts, and binary data manipulation.
Java || vs |: Logical and Bitwise OR Explained
java || vs |: Understand the difference between || and | in Java, including short-circuit behavior, bitwise semantics, and when to use each.
Java && vs &: Short-Circuit vs Bitwise AND
Understand the difference between Java's && and & operators: short-circuit evaluation, bitwise operations, and when to use each.
Java ! Operator: Logical NOT Explained
java ! operator: Learn how the Java ! operator negates boolean values, where it works, common pitfalls, and how to use it in conditions and null checks.
Java || Operator: Short-Circuit Logic Explained
java || operator: Understand how the Java || operator works, including short-circuit behavior, precedence, and common pitfalls.
Java && Operator: Short-Circuit Logic Explained
java && operator: Understand the Java && operator, its short-circuit behavior, practical usage in conditions, and how it differs from the bitwise & operator.