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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

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 »

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: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

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 9 guests