Jump to content

SingletonList

From EggeWiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Instead of writing <geshi lang="java"> List<String> list = new ArrayList(); list.add(item); </geshi>

You can simply write: <geshi lang="java"> List<String> list = Collections.singletonList(item); </geshi>