接口注释
public class ArrayTool {
private ArrayTool(){};
public static int getMax(int[] arr){
int max = 0;
for(int x = 0; x < arr.length; x++){
if(arr[x]>arr[max])
max = x;
}
return arr[max];
}
public static int getMin(int[] arr){
int min = 0;
for(int x = 0; x < arr.length; x++){
if(arr[x]<arr[min])
min = x;
}
return arr[min];
}
public static void bubbleSort(int[] arr){
for(int x = 0; x < arr.length - 1; x++){
for(int y = 0; y < arr.length - x - 1; y++){
samp(arr,y,y+1);
}
}
}
public static void selectSort(int[] arr){
for(int x = 0; x < arr.length - 1; x++){
for(int y = x + 1; y < arr.length; y++){
samp(arr,x,y);
}
}
}
private static void samp(int[] arr, int x, int y){
if(arr[x]>arr[y]){
int temp = arr[x];
arr[x] = arr[y];
arr[y] = temp;
}
}
public static void printArr(int[] arr){
System.out.print("[");
for(int x = 0; x < arr.length; x++){
if(x!=arr.length-1)
System.out.print(arr[x]+",");
else
System.out.println(arr[x]+"]");
}
}
}
javadoc生成
javadoc -encoding UTF-8 -d myhelp -author -version ArrayTool.java
结果显示
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200703161537901.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MDk3MDk4Nw==,size_16,color_FFFFFF,t_70)