Markdown in Javadoc comments
Write Javadoc comments in Markdown instead of HTML for better readability.
কোড তুলনা
✕ Java 8
/**
* Returns the {@code User} with
* the given ID.
*
* <p>Example:
* <pre>{@code
* var user = findUser(123);
* }</pre>
*
* @param id the user ID
* @return the user
*/
public User findUser(int id) { ... }
✓ Java 23+
/// Returns the `User` with
/// the given ID.
///
/// Example:
/// ```java
/// var user = findUser(123);
/// ```
///
/// @param id the user ID
/// @return the user
public User findUser(int id) { ... }
এই কোডে সমস্যা দেখছেন? আমাদের জানান।
কেন আধুনিক পদ্ধতি ভালো
Natural syntax
Use backticks for inline code and ``` for blocks instead of HTML tags.
Easier to write
No need for {@code}, <pre>, <p> tags — just write Markdown.
Better in editors
Markdown renders beautifully in modern IDEs and text editors.
পুরনো পদ্ধতি
HTML-based Javadoc
আধুনিক পদ্ধতি
Markdown Javadoc
JDK থেকে
23
কঠিনতা
প্রাথমিক
JDK সমর্থন
Markdown in Javadoc comments
উপলব্ধ
Available since JDK 23 (Sept 2024)
কীভাবে কাজ করে
Java 23 introduces /// Markdown-style Javadoc comments as an alternative to the traditional /** */ HTML-based format. Markdown syntax is more natural to write and read, with support for code blocks, emphasis, lists, and links. The compiler converts Markdown to HTML for javadoc output.
সম্পর্কিত ডকুমেন্টেশন
প্রমাণ