About Question enthuware.ocpjp.v17.2.3672 :

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

Moderator: admin

Post Reply
likejudo
Posts: 26
Joined: Sun Feb 18, 2024 7:21 pm
Contact:

About Question enthuware.ocpjp.v17.2.3672 :

Post by likejudo »

Code: Select all

        String s = "["+"""
                                                """+"]";
        System.out.println(s);
I was surprised to see the output is:
[]
even though there are leading spaces?!

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

Re: About Question enthuware.ocpjp.v17.2.3672 :

Post by admin »

Not sure if you are asking a question or merely noting that you are surprised. Just in case you are asking why, you need to find out what is essential and what is incidental white space instead of focusing on leading whitespace and non leading whitespace.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 227 guests