Skip to content

Commit af3ad78

Browse files
committed
Section 21 Annotations and Java Doc
Signed-off-by: https://github.com/Someshdiwan <[email protected]>
1 parent f0e4b68 commit af3ad78

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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

0 commit comments

Comments
 (0)