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

Moderator: admin

Post Reply
tomdkt
Posts: 1
Joined: Fri May 15, 2015 10:03 am
Contact:

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

Post by tomdkt » Wed Jul 11, 2018 4:58 pm

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))); }

admin
Site Admin
Posts: 7261
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin » Wed Jul 11, 2018 9:35 pm

I see that the correct answer is indeed set as option 4, which is false false.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests