读书人

String种之intern()

发布时间: 2012-10-21 09:00:07 作者: rapoo

String类之intern()
API说明部分:
When the intern method is invoked, if the pool already contains a string equal to this String object as determined by the equals(Object) method, then the string from the pool is returned. Otherwise, this String object is added to the pool and a reference to this String object is returned.

测试1:
------------------------------------------------------------------

 基础知识,不容忽视!!! 

读书人网 >编程

热点推荐