Browsing category Java

StringBuilder & StringBuffer

Modifiable Strings by StringBuilder & StringBuffer


In previous blog, we discussed on String and string constant pool.  It highlighted the issue in String manipulation and how it fill the pool memory.  We not recommended to use String for temporary string statement formation, logger statement, updatable string values, large file I/O stream of input processing.  We can process these operation using String

java static nested class, static inner class.

Avoid Package with One class By Static Nested Class


In the previous post, we discussed on inner class for “one and only for” relationship among the classes. But static nested class not for same purpose, it is to add namespace to the class.  It can be instantiated just with top class name (without top class instance).  Static nested class is class scoped within another.

Shallow copy of java objects

Shallow vs Deep Copy of Object by Clone() method


Previous post, we discussed on intention to create copy of object in java. In this post,we would discuss on different implementation of object copying. Before discuss on implementation, let us discuss on basic rule of clone copy implementation. 1) Copy of object and actual object should not refer at same object. If it is same,