Browsing category Java

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,

java clone.

Intention to Create Copy of Java Objects


Java application created by group of objects. Every time we create object to represent the real time objects. “new” operation creates and builds new object for the class.  But real-time scenario,  we may require to create exact copy of java object in enterprise application.  Below list of use cases to create copy of objects in

doc comment in java

Writing comments in java and Generating document by “javadoc”.


The Java language supports three types of comments in code to explain the business logic in code, to explain the algorithm logic to other developers in code itself or to generate the document content in coding itself. Single line comments : //…………………. Multi line comments : /* ………………. */ Documentation comments /** Document Content */

Pass by value vs pass by reference in java

Java Methods are “Pass by Value”


We are writing method to accomplish business logic in application. We have to pass the argument to methods for processing. We have to understand how the arguments are passed to methods as “Pass by Value”.  Understanding of this is important as we can populate and set the value of object properties in the method body