专栏名称: java那些事
分享java开发中常用的技术,分享软件开发中各种新技术的应用方法。每天推送java技术相关或者互联网相关文章。关注“java那些事”,让自己做一个潮流的java技术人!《java程序员由笨鸟到菜鸟》系列文章火热更新中。
目录
相关文章推荐
芋道源码  ·  别乱分层,PO、VO、DAO、BO、DTO、 ... ·  10 小时前  
芋道源码  ·  谈一谈 分库分表 vs NewSQL数据库 ·  昨天  
芋道源码  ·  SQL性能优化神器! ·  2 天前  
芋道源码  ·  Spring Boot 3.2 ... ·  2 天前  
芋道源码  ·  解放大脑:ChatGPT + ... ·  2 天前  
51好读  ›  专栏  ›  java那些事

Java编程中,有哪些好的习惯从一开始就值得坚持?

java那些事  · 公众号  · Java  · 2018-12-28 16:00

正文

请到「今天看啥」查看全文


URL}. The name
* argument is a specifier that is relative to the url argument.
*


* This method always returns immediately, whether or not the
* image exists. When this applet attempts to draw the image on
* the screen, the data will be loaded. The graphics primitives
* that draw the image will incrementally paint on the screen.
*
* @param url  an absolute URL giving the base location of the image
* @param name the location of the image, relative to the url argument
* @return the image at the specified URL
* @see Image
*/
public Image getImage(URL url, String name) {
try {
return getImage( new URL(url, name));
} catch (MalformedURLException e) {
return null ;
}
}



文档是用HTML语言写成的,前半部分是关于当前方法或类的描述,后面需要有参数标签@param和返回标签@return,还可以加一些别的标签,比如@see,只有这样,当别人试图引用你的程序时,才能马上明白你的某段程序是用来干嘛的,参数传递,返回等一目了然,要知道,实际工作中,大量的协作就意味着代码需要高度的重用性,你必须把你的程序封装完美,并且让别人仅仅看你的文档,就知道你的这个API怎么用。


上面说的仅仅是编程规范的冰山一角了,问题是,你有时会忘掉或用错一些规范,即便你知道它。


所以我们需要使用checkstyle插件去自动检测我们的程序是否符合规范。







请到「今天看啥」查看全文