Page 1 of 1

About Question enthuware.ocajp.i.v7.-2.-1392 :

Posted: Wed Jul 11, 2018 4:58 pm
by tomdkt
Hello, Running de code in java will gave me 'false false'. In the Tests it says true and false

public static void main(String[] args) { String myStr = "good"; char[] myCharArr = {'g', 'o', 'o', 'd' }; String newStr = null; for(char ch : myCharArr){ newStr = newStr + ch; } System.out.println((newStr == myStr)+ " " + (newStr.equals(myStr))); }

Re: About Question enthuware.ocajp.i.v7.2.1392 :

Posted: Wed Jul 11, 2018 9:35 pm
by admin
I see that the correct answer is indeed set as option 4, which is false false.