Skip to content

Commit 7c506d3

Browse files
committed
feat: Java 注释
1 parent 1f416f7 commit 7c506d3

17 files changed

Lines changed: 2153 additions & 0 deletions
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package com.wdbyte.comment;
2+
3+
/**
4+
* 输出一个名称和地域的问候信息。
5+
* 如:Hello 朋友,welcome to 杭州
6+
* 主要实现方法是 {@link JavaDocDemo#getMessage(String, String)}
7+
*
8+
* @author wdbyte
9+
* @version 1.0
10+
* @see com.wdbyte.comment.JavaDocDemo#getMessage(String, String)
11+
* @since 1.0
12+
*/
13+
public class JavaDocDemo {
14+
15+
/**
16+
* 启动应用程序
17+
*
18+
* @param args - 应用启动参数
19+
*/
20+
public static void main(String[] args) {
21+
System.out.println(getMessage("朋友", "杭州"));
22+
}
23+
24+
/**
25+
* 返回一个欢迎信息。
26+
* @see <a href="https://docs.oracle.com/en/java/">Java Dcoumentation</a>
27+
* @param name - 访问者名称
28+
* @param region - 地域信息
29+
* @return - 欢迎信息语句
30+
*/
31+
public static String getMessage(String name, String region) {
32+
StringBuilder builder = new StringBuilder();
33+
builder.append("Hello ");
34+
builder.append(name);
35+
builder.append(", Welcome to ");
36+
builder.append(region);
37+
builder.append(" !!");
38+
return builder.toString();
39+
}
40+
41+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package com.wdbyte.comment;
2+
3+
/**
4+
* 输出一个名称和地域的问候信息。
5+
* 如:Hello 朋友,welcome to 杭州
6+
*
7+
* @author https://www.wdbyte.com
8+
*/
9+
public class WelcomeMain {
10+
11+
/**
12+
* 启动应用程序
13+
*
14+
* @param args - 应用启动参数
15+
*/
16+
public static void main(String[] args) {
17+
System.out.println(getMessage("朋友", "杭州"));
18+
}
19+
20+
/**
21+
* 返回一个欢迎信息。
22+
*
23+
* @param name - 访问者名称
24+
* @param region - 地域信息
25+
* @return - 欢迎信息
26+
*/
27+
public static String getMessage(String name, String region) {
28+
StringBuilder builder = new StringBuilder();
29+
builder.append("Hello ");
30+
builder.append(name);
31+
builder.append(", Welcome to ");
32+
builder.append(region);
33+
builder.append(" !!");
34+
return builder.toString();
35+
}
36+
37+
38+
/**
39+
* 计算两数之和
40+
* @param x 数字1
41+
* @param y 数字2
42+
* @return
43+
*/
44+
public int add(int x, int y) {
45+
/*
46+
* 计算两数之和
47+
*/
48+
int s = x + y;
49+
return s;
50+
}
51+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2+
<!-- NewPage -->
3+
<html lang="zh">
4+
<head>
5+
<!-- Generated by javadoc (1.8.0_151) on Wed Jun 21 17:11:19 CST 2023 -->
6+
<title>所有类</title>
7+
<meta name="date" content="2023-06-21">
8+
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
9+
<script type="text/javascript" src="script.js"></script>
10+
</head>
11+
<body>
12+
<h1 class="bar">所有类</h1>
13+
<div class="indexContainer">
14+
<ul>
15+
<li><a href="com/wdbyte/comment/JavaDocDemo.html" title="com.wdbyte.comment中的类" target="classFrame">JavaDocDemo</a></li>
16+
</ul>
17+
</div>
18+
</body>
19+
</html>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2+
<!-- NewPage -->
3+
<html lang="zh">
4+
<head>
5+
<!-- Generated by javadoc (1.8.0_151) on Wed Jun 21 17:11:19 CST 2023 -->
6+
<title>所有类</title>
7+
<meta name="date" content="2023-06-21">
8+
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
9+
<script type="text/javascript" src="script.js"></script>
10+
</head>
11+
<body>
12+
<h1 class="bar">所有类</h1>
13+
<div class="indexContainer">
14+
<ul>
15+
<li><a href="com/wdbyte/comment/JavaDocDemo.html" title="com.wdbyte.comment中的类">JavaDocDemo</a></li>
16+
</ul>
17+
</div>
18+
</body>
19+
</html>

0 commit comments

Comments
 (0)