0

I was wondering about how strings are instantiated. For instance:

String strObject = new String("Java");//String constructor gets called which creates object

Using String literal also creates object.

String strLiteral = "Java";// What is responsible to create the object?

Just need to know how it actually creates object, gone through String Class source code, nothing found.

Duloren
  • 2,395
  • 1
  • 25
  • 36
Javed Solkar
  • 162
  • 11

0 Answers0