Basically there are three way to convert an primitive value to string so that if we have requirement to use that primitive as a string then we can you this concept and way of conversion but now the point is out of these three way which one is the best and take less time and doesn't have any performance issue.
The three ways of converting primitive into string are :
1. Using Empty string
2. Using valueOf() with String class
3. Using toString()...

String is a reference data type and hence string literals are treated as object and get stored in the string constant pool. We must have to define any string within double-quote otherwise it will give compilation error. String can be represented in two form either with using ' new ' operator or without using new operator.
Two way of string representation in java :
1....
It is the manually implemented coding for doing cloning. This concept has came to overcome the limitation found with shallow cloning which fails to clone the data member. Through deep cloning we can be able to cover up the problem with the shallow cloning. Now with the help of deep cloning we can able to clone the object members as well but to achieve this we don't have any predefined method, so we need to write our own code. Deep Cloning is just...

It is a default cloning in java implemented by the Java vendor simply by using one predefined method in the Object class i.e clone(). Using shallow cloning we can only be able to clone the member of the class but fails to clone object members of the class. To clone the object member we need to write our own code which is also called as Deep Cloning.
To achieve...
Cloning is a concept used to create a new object of the existing object. It means creating another object in the memory same as the existing one by copying the content of it.
For cloning a object java vendor has provided a method i.e clone() method in the Object class which is used to clone the object.
Clone() method is defined as protected in the Object and return the Object class object. Signature of the clone() is :-
protected Object...
Subscribe to:
Posts (Atom)