I have kept a copy of vo1 object in vo4 object not a reference.
No, you've pointed the variables vo1 and vo4 at the same object, like this:
+-----+
| vo1 |--------\
+-----+ \ +----------------+
--->| (object) |
+-----+ / | name = Abishek |
| vo4 |--------/ +----------------+
+-----+
Let's follow the code through:
VO vo1 = new VO();
Gives us:
+-----+ +----------------+
| vo1 |------------->| (object) |
+-----+ | name = null |
+----------------+
Then:
VO vo2 = new VO();
Now we have:
+-----+ +----------------+
| vo1 |------------->| (object) |
+-----+ | name = null |
+----------------+
+-----+ +----------------+
| vo2 |------------->| (object) |
+-----+ | name = null |
+----------------+
Then:
VO vo3;
...which just creates vo3 with null (not pointing at any object).
Then:
VO vo4 = new VO();
So we have:
+-----+ +----------------+
| vo1 |------------->| (object) |
+-----+ | name = null |
+----------------+
+-----+ +----------------+
| vo2 |------------->| (object) |
+-----+ | name = null |
+----------------+
+-----+
| vo3 | (is null)
+-----+
+-----+ +----------------+
| vo4 |------------->| (object) |
+-----+ | name = null |
+----------------+
Now:
vo1.setName("Sourav");
vo2.setName("Anil");
Gives us:
+-----+ +----------------+
| vo1 |------------->| (object) |
+-----+ | name = Sourav | *** change is here ***
+----------------+
+-----+ +----------------+
| vo2 |------------->| (object) |
+-----+ | name = Anil | *** and here ***
+----------------+
+-----+
| vo3 | (is null)
+-----+
+-----+ +----------------+
| vo4 |------------->| (object) |
+-----+ | name = null |
+----------------+
Here's where things get interesting:
vo3 = vo1;
vo4 = vo1;
That points vo3 at the same object vo1 points to, and points vo4 at that object as well, releasing the object vo4 used to point to (which becomes eligible for garbage collection). Giving us:
+-----+
| vo1 |----\
+-----+ \
\
+-----+ \ +----------------+
| vo3 |------------->| (object) |
+-----+ / | name = Sourav |
/ +----------------+
+-----+ /
| vo4 |----/
+-----+
+-----+ +----------------+
| vo2 |------------->| (object) |
+-----+ | name = Anil |
+----------------+
Now
System.out.println(" " + vo4.getName());
...gives us "Sourav" as you'd expect.
Then
vo1.setName("Abhishek.");
...changes the object that vo1, vo3, and vo4 are all pointing to:
+-----+
| vo1 |----\
+-----+ \
\
+-----+ \ +----------------+
| vo3 |------------->| (object) |
+-----+ / | name = Abishek |
/ +----------------+
+-----+ /
| vo4 |----/
+-----+
+-----+ +----------------+
| vo2 |------------->| (object) |
+-----+ | name = Anil |
+----------------+
...and so getName() on vo1, vo3, or vo4 will give you "Abishek."