一般利用公司域名的倒置作为包名
例如
com.baidu.www
Alt+回车 自动查看错误信息
Ctrl+D 自动复制本行内容到下一行
Ctrl+鼠标右键 跳转到Java文档信息
在java中使用Date需要导入包
import java.util.Date
import必须在package下面
package必须放在最上面
尽量不要让包中的名字重复
这个包中的Demo01已经被定义过了
import java.com.kuang.www.*;
可以导入com.kuang.www这个包下的所有类
阿里巴巴开发手册一定要常看
JavaDoc命令是用来生成自己API文档的
需要常看的文档:
JDK8帮助文档
JavaDoc
参数信息:
- @author 作者名
- @version 版本号
- @ since 指明需要最早使用的jdk版本
- @param 参数名
- @return 返回值情况
- @throws 异常抛出情况
加在类上就是类的注释,加载方法上就是方法的注释
如何使用cmd生成javadoc文档:
javadoc 参数 Java文件
老师的示范:
自己的尝试:
//作业:学会查找使用IDEA生成javadoc文档
看IDEA如何配置后生成javadoc文档
one
two
解释一哈:
选择是整个项目还是模块还是单个文件
文档输出路径
Locale 选择地区,这个决定了文档的语言,中文就是zh_CN
传入JavaDoc的参数,一般这样写 -encoding UTF-8 -charset UTF-8 -windowtitle “文档HTML页面标签的标题” -link http://docs.Oracle.com/javase/7/docs/api
可以看到控制台的输出:
然后找到生成的html:
看一下效果:
————————————————
版权声明:本文为CSDN博主「张鲜生」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_42140580/article/details/89635775
自己尝试:
控制台: