Effective Java 47 Know and use the libraries
Advantages of use the libraries
- By using a standard library, you take advantage of the knowledge of the experts who
wrote it and the experience of those who used it before you.
Use Random.nextInt(int) to get the random number without flaw.
 - You don't have to waste your time writing ad hoc solutions to problems that are only marginally related to your work.
 - Performance tends to improve over time, with no effort on your part.
 - Libraries maintained by community also tend to gain new functionality over time.
 - Standard libraries is that you place your code in the mainstream. Such code is more easily readable, maintainable, and reusable by the multitude of developers.
 
Libraries you should know
Every programmer should be familiar with the contents of java.lang, java.util, and, to a lesser extent, java.io. Collections Framework under java.util, Java.util.concurrent.
Summary
Don't reinvent the wheel. If you need to do something that seems like it should be reasonably common, there may already be a class in the libraries that does what you want. If there is, use it; if you don't know, check. Economies of scale dictate that library code receives far more attention than most developers could afford to devote to the same functionality.
Effective Java 47 Know and use the libraries的更多相关文章
- Effective Java Index
		
Hi guys, I am happy to tell you that I am moving to the open source world. And Java is the 1st langu ...
 - Effective Java 第三版——47. 优先使用Collection而不是Stream来作为方法的返回类型
		
Tips <Effective Java, Third Edition>一书英文版已经出版,这本书的第二版想必很多人都读过,号称Java四大名著之一,不过第二版2009年出版,到现在已经将 ...
 - effective java —— 终结方法守卫者
		
目录: effective java —— 终结方法守卫者 effective java 第2章:创建和销毁对象.第7条 : 避免使用终结方法.最后的“终结方法守卫者 (finalizer guard ...
 - [Effective Java]第八章 通用程序设计
		
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
 - Effective Java通俗理解(下)
		
Effective Java通俗理解(上) 第31条:用实例域代替序数 枚举类型有一个ordinal方法,它范围该常量的序数从0开始,不建议使用这个方法,因为这不能很好地对枚举进行维护,正确应该是利用 ...
 - 《Effective Java(中文第二版)》【PDF】下载
		
<Effective Java(中文第二版)>[PDF]下载链接: https://u253469.pipipan.com/fs/253469-230382186 Java(中文第二版)& ...
 - Effective Java 第三版——17.  最小化可变性
		
Tips <Effective Java, Third Edition>一书英文版已经出版,这本书的第二版想必很多人都读过,号称Java四大名著之一,不过第二版2009年出版,到现在已经将 ...
 - Effective Java 第三版——46. 优先考虑流中无副作用的函数
		
Tips <Effective Java, Third Edition>一书英文版已经出版,这本书的第二版想必很多人都读过,号称Java四大名著之一,不过第二版2009年出版,到现在已经将 ...
 - Effective Java 目录
		
<Effective Java>目录摘抄. 我知道这看起来很糟糕.当下,自己缺少实际操作,只能暂时摘抄下目录.随着,实践的增多,慢慢填充更多的示例. Chapter 2 Creating ...
 
随机推荐
- Vim杂记:markdown插件
			
一.安装插件 从以下地址下载压缩包 github下载:https://github.com/plasticboy/vim-markdown plasticboy下载:http://plasticboy ...
 - .Net魔法堂:史上最全的ActiveX开发教程——开发篇
			
一.前言 在设计某移动内部自动化运维平台时,经综合考虑终端机性能和功能需求等因素后,决定采用B/S模式,并且浏览器通过ActiveX组件实现与服务器Agent作P2P的通讯.好处,整个平台以网页形式存 ...
 - MVC ,Action方法传数据给视图有几种方式?--PS:tempData和Viewbag,还有ViewData之间的区别
			
//---------------------------------控制器向视图传递数据 public ActionResult TransData() { //1.ViewBag ViewBag. ...
 - 重构第10天:提取方法(Extract Method)
			
理解:经常写的代码中,有一些计算逻辑比较复杂的方法,写下来一个很长很长的方法,我们可以把这个方法,根据功能,分解成单独的几个小方法.这样做不仅能够增加代码的可维护性,而且增加了易读性. 详解: 重构前 ...
 - 因用了NeatUpload大文件上传控件而导致Nonfile portion > 4194304 bytes错误的解决方法
			
今天遇到一个问题,就是“NeatUpload大文件上传控件而导致Nonfile portion > 4194304 bytes错误”,百度后发现了一个解决方法,跟大家分享下: NeatUploa ...
 - ScriptManager和UpdatePanel控件实现局部刷新
			
ScriptManager和UpdatePanel控件联合使用可以实现页面异步局部更新的效果.其中的UpdatePanel就是设置页面中异步局部更新区域,它必须依赖于ScriptManager存在,因 ...
 - ExtJs特点、优缺点及注意事项
			
摘自:ExtJs特点.优缺点及注意事项 1.什么是ExtJs?ExtJS可以用来开发RIA也即富客户端的AJAX应用,是一个用javascript写的,主要用于创建前端用户界面,是一个与后台技术无关的 ...
 - 【C#】1.1 第1章学习要点
			
分类:C#.VS2015 创建日期:2016-06-14 教材:十二五国家级规划教材<C#程序设计及应用教程>(第3版) 一.配套源程序(VS2015版)的运行截图 VS2015版的配套源 ...
 - spring中常用工具类介绍
			
http://www.cnblogs.com/langtianya/p/3875103.html 文件资源操作 Spring 定义了一个 org.springframework.core.io ...
 - QTimer太让人失望了,一秒触发一次事件都不准确。。
			
今天做项目中,我用QTimer来模拟数据生成,在另外的设备上接受.另外设备上有时1秒读不到数据,查询原因很久,终于发现是QTimer的问题. 测试代码如下 有兴趣同学可以自己试试. t = new Q ...