Error in OCAJP Java 8 book

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

Moderator: admin

Post Reply
ardurn
Posts: 4
Joined: Thu Mar 05, 2020 4:56 pm
Contact:

Error in OCAJP Java 8 book

Post by ardurn »

Hello,

there is an error in section "12.1.3 Manipulating Strings" in the example code that a string manipulation method returns the same string if it is unchanged:

Code: Select all

System.out.println(s1.strip() == s1);
The strip method was introduced in Java 11 and therefore is not available in Java 8

Best regards
ardurn

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

Re: Error in OCAJP Java 8 book

Post by admin »

You are right. It should be trim()!
thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests