Java Primitives Types

Primitives

Comparing

Immutable – create new one (> -XX:AutoBoxCacheMax)

Integer cache (autoboxing and cashing with Integer.valueOf(int))

Integer Generics Collections Autoboxing

Strings in Java – String pool

Strings are immutable and final in Java – stored in PermGen Space Strings are maintained in String Pool – using new for creating instance led skipping String Pool Use Equals methods for comparing String in Java Strings are not null terminated in Java Use indexOf() and lastIndexOf() or matches(String regex) method to search inside String […]