1. 4
  2. 3
  3. 2
  4. None of this

Share with your friends
AhmedNazir

Call

Answer: Option 2

Object will be created each time whenever we use new keyword. So, 2 object will be created simply for the first two line and matter is with remaining two bottom line. String c="examveda" creates an object and store it in String pool, next time when we are writing String d="examveda" it will first check in String pool whether object already exists or not. Since, it is existing, no new object will be created. Hence reference "d" points to existing object "examveda". So ultimately 3 object will be created at the end.

Talk Doctor Online in Bissoy App