1. when we initialize value,
and
both of them are correct right?
Which of the two could consume greater memory space?
And about comparing strings.
the code executes
if
then why we cannot compare it to null? NullPointerExce ption occured,
Since the string could be compare into null...
by
Is the method equals in String only accepts "" instead of null?
Is the implementation of equals method is to get the parameter value then count the value's length?
Im getting inspired already,
Sukatoa
Code:
String st = new String("the quick brown fox jump over the lazy dog");
Code:
String st = "the quick brown fox jump over the lazy dog";
Which of the two could consume greater memory space?
And about comparing strings.
Code:
st.equals(another string)
if
Code:
st.equals(null);
Since the string could be compare into null...
by
Code:
st == null;
Is the implementation of equals method is to get the parameter value then count the value's length?
Im getting inspired already,
Sukatoa
Comment