monikma / monikma.github.io

Mona's learning blog
Apache License 2.0
6 stars 6 forks source link

Java 8 OCA 1Z0 808 exam checklist #31

Open monikma opened 8 years ago

PreetySethi commented 5 years ago

It is really helpful to me. I was expecting this summary, felt to write of my own but luckily I got your post. Thank you so much..I am preparing for OCA 8 just after a couple of days I will be appearing. And It boosted my preparation thankyou

jonadv commented 3 years ago

Great list, thanks. Small addition on the string comparisons:

"the result of "abc"+"d" is already a new String, not the one from String pool"

Writing "abcd" =="abc" +"d" will actually get the same string out of the pool and therefor compile to true, because the latter being compile time constants. However if "d" was wrapped in a (not final) variable, it would create a new String at runtime indeed and result to false.