I am just starting out with Java. But I had a big puzzle when I am in the first chapter.
It says that we have to "initialize" the handle when we are creating one, like String s = "asdf"
, and later it says we have create a new object for the string s
again, String s = new String("asdf");
.
I think the string s
already has an object (asdf) in the "initialization", but why we still have to re-create it again(if I am understanding it right)?
Hope someone can explain this more to me, in book it is just skipped.