File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Section21AnnotationsandJavaDoc/src Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ # Section 21 – Annotations and JavaDoc (Quick Notes)
2+
3+ ## Annotations
4+ - Metadata that provides extra information to the compiler or JVM
5+ - Common built-in annotations:
6+ - @Override → ensures a method overrides a parent method
7+ - @Deprecated → marks a method or class as outdated
8+ - @SuppressWarnings → tells the compiler to ignore specific warnings
9+ - You can also create custom annotations using @interface
10+
11+ ## JavaDoc
12+ - Tool to generate documentation directly from comments in source code
13+ - Special format:
14+ /**
15+ This is a JavaDoc comment
16+ @param x description
17+ @return result
18+ */
19+ - Common tags:
20+ - @param → describes method parameters
21+ - @return → describes the return value
22+ - @throws → describes exceptions
23+ - @author, @version
24+
25+ ## Why Important?
26+ - Annotations help write cleaner code, reduce boilerplate, and are widely used in frameworks like Spring and JPA
27+ - JavaDoc helps generate professional documentation and improves maintainability
You can’t perform that action at this time.
0 commit comments