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 ...

Manipulation of String (Sequence of characters) is most important aspect of programming language. Name, id, address, role and username all manipulated as String in programming world.  Java is no different from other language while using the String.  In Java, String ...

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 ...

Before start discussion on inner class, let us discuss simple analogy. Boat and Fin(Flipper). Fin exists only for boat an to help boat to move in river. Fin would not be useful if there is no boat. But Fin is ...

Java coding practices recommended that maximum 80 characters in single line of the code.  It is best for readability and understand the code. If our class require static members in more than 20 lines of our code and all lines ...

Recently I had chance to meet my college junior, he said he started learning Java.  I appreciated him for learning new programming skill.  He is from C programming background, he said it is easy to learn java and he said ...

Java methods accept parameters, execute business logic and return results. We can pass multiple argument to the methods and it return only one value from the methods. Some real time scenario, we may require to get more than one return ...

Java encourages use of OOPS features such as inheritance and encapsulation. But in special cases, we want to restrict the change of our class or method or member variables or local variables. Here “final” keyword helps to mark the element ...

In the previous post, we discussed on creating the copy of object by clone() method. But one of main shortcome in the clone method is assigning value to final variables. Final variables can be assigned in declaration or in constructors.  ...

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 ...