Pages

Topics

Tools

↑↓navigate↵openescclose

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

Latest guides

Diagram showing a single char primitive next to a String object with multiple characters, illustrating the difference in structure.
Java

Java char vs String: Key Differences and Usage

java char vs string: Understand the core differences between Java's char primitive and String class, including usage, memory, and performance.

JavaStringcharprimitive types
Diagram comparing Java int and long primitive types showing their bit widths and value ranges with a memory footprint illustration
Java

Java int vs long: Choosing the Right Primitive

Compare Java's int and long primitives: ranges, memory cost, overflow behavior, conversion pitfalls, and practical selection criteria for production code.

Java primitivesinteger overflowtype conversionmemory usage
Editorial illustration comparing a compact float value and a wider double value, showing precision and memory tradeoffs in Java.
Java

Java float vs double: Precision and Memory Tradeoffs

Compare Java float vs double: precision, range, memory footprint, literal rules, rounding behavior, and practical guidance for choosing the right type.

Javafloating-pointprimitive typesnumeric precision
A diagram showing the size and range of Java integer primitive types byte, short, int, and long.
Java

Java byte, short, int, and long: Differences and Usage

Understand the size, range, conversion, and overflow behavior of Java's byte, short, int, and long types, and when to use each.

Javaprimitive typesinteger typestype conversion
Illustration of Java boolean type showing true and false values with code snippets
Java

Java Boolean Type: Syntax and Pitfalls

Understand the Java boolean type through practical examples: declaration, logical operators, autoboxing and nullable Boolean, performance trade-offs, and common mistakes.

booleanprimitive typesautoboxingshort-circuit evaluation
Diagram showing a Java char as a 16-bit container that splits a supplementary Unicode character into two surrogate code units.
Java

Java char Type: What It Stores and Where It Breaks

Understand what Java's char type actually stores, how it behaves numerically, and why it fails for supplementary Unicode characters.

charUnicodeUTF-16code points
Diagram showing the IEEE 754 double-precision floating-point format with sign, exponent, and mantissa bits.
Java

Java double type: Precision, Syntax, and Pitfalls

Understand the Java double type: its precision limits, syntax, common pitfalls, and how to handle floating-point arithmetic correctly in Java.

Javafloating-pointdouble-precisionIEEE 754
Diagram illustrating the 32-bit float type structure with sign, exponent, and mantissa parts.
Java

Java float Type: Precision, Usage, and Pitfalls

Learn how the Java float type works, how it differs from double, and which precision-related pitfalls to avoid.

Javafloating-pointprimitive typesprecision
Illustration of the Java long type showing a 64-bit integer range boundary with overflow wrapping to a negative value.
Java

Java long Type: Range, Syntax, and Pitfalls

Understand the Java long type: its 64-bit range, literal syntax, conversion rules, overflow behavior, and the pitfalls that cause subtle numeric bugs.

Java primitivesnumeric overflowtype conversionLong wrapper
Illustration of the Java int type showing its 32-bit range boundary and overflow wrapping behavior.
Java

Java int Type: Range, Overflow, and Practical Usage

Understand the Java int type: its 32-bit range, arithmetic promotion, overflow behavior, and how to choose between int, long, and Integer.

Java primitivesInteger overflowAutoboxingNumeric type promotion