Java guides
Every published Java guide, newest first, with practical examples you can copy into your own project.
3,965 guides across 14 topics
Topics
Popular Java guides
Most readLatest Java guides
Page 22 of 109Java @Target Annotation: Restricting Where Annotations Apply
Learn how Java's @Target meta-annotation restricts where custom annotations can be applied, with ElementType values, code examples, and common pitfalls.
Java Retention Annotation: How to Control Annotation Lifecycle
Understand how Java's @Retention meta-annotation controls whether annotations are available in source code, compiled class files, or at runtime, and how to choose the right policy.
Java Annotation Declaration: Syntax and Usage
Learn how to declare custom annotations in Java, set retention and target, define elements, and process them with reflection.
Java Custom Annotation: Syntax, Retention, and Processing
Learn how to create Java custom annotations, control their retention and targets, and process them at runtime with reflection.
Java SuppressWarnings: When and How to Use It
Learn how to use Java's @SuppressWarnings annotation: syntax and placement, common warning names, and when suppressing a compiler warning is justified versus when it hides real problems.
Using @Deprecated in Java to Manage API Evolution
Learn how to use Java's @Deprecated annotation to mark outdated APIs, manage compiler warnings, and plan API removal.
Java Built-In Annotations: Usage and Pitfalls
Learn how Java's built-in annotations @Override, @Deprecated, @SuppressWarnings, @FunctionalInterface, and @SafeVarargs work, including retention, targets, and common mistakes.
Java Annotation Syntax: Declaring and Using Annotations
Learn the exact syntax for declaring and using Java annotations, including retention policies, target restrictions, and runtime reflection processing.
Java Annotations: Syntax, Retention, and Runtime Use
A practical guide to Java annotations: declaration syntax, retention policies, reflection-based runtime lookup, and common pitfalls when creating custom annotations.
Java Regex Groups: Capturing and Named Groups
Learn how to use capturing groups, named groups, and backreferences in Java regex with practical examples.