About Question enthuware.ocajp.i.v7.2.1304 :

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

Moderator: admin

Post Reply
darran85
Posts: 1
Joined: Thu Apr 11, 2013 5:10 am
Contact:

About Question enthuware.ocajp.i.v7.2.1304 :

Post by darran85 »

The question says
Which of these are not part of the StringBuilder class?

You mark as correct

setLength(int)

that IS part of the StringBuilder class. I think there's an error in this question!

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

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

Post by admin »

I see that it is marked as incorrect.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

Arold Aroldson
Posts: 21
Joined: Mon Nov 20, 2017 8:00 am
Contact:

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

Post by Arold Aroldson »

What exactly we should know about StringBuilder class? I've never seen and/or used setLength method, for example.

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

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

Post by admin »

If you like our products and services, please help us by posting your review here.

promtbvb
Posts: 3
Joined: Thu Jun 11, 2020 4:17 pm
Contact:

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

Post by promtbvb »

Hi,
09 - Working with Java API - String, StringBuilder    Easy.png
09 - Working with Java API - String, StringBuilder Easy.png (49.15 KiB) Viewed 2605 times
There are 2 correct answers trim() and setLengght(), but only one is marked as correct.
Am I missing something?

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

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

Post by admin »

No, there is only one correct option i.e. option 1.
Please read the question carefully. It says "NOT part of".
If you like our products and services, please help us by posting your review here.

noeloo
Posts: 61
Joined: Sat Feb 15, 2020 8:56 am
Contact:

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

Post by noeloo »

Not sure where is the setLength method description copied from, but it describes string buffer, while the question is not about StringBuffer?
Javadoc of setLenght in AbstractStringBuilder doesn't mention neither string builder not buffer.
Sets the length of the character sequence.

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

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

Post by admin »

Both StringBuilder and StringBuffer are based on an internal "buffer" of characters or character sequence. The description is applicable to both.
If you like our products and services, please help us by posting your review here.

noeloo
Posts: 61
Joined: Sat Feb 15, 2020 8:56 am
Contact:

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

Post by noeloo »

This looks like Javadoc, maybe the old one. Wouldn't it be better to include the new one in the question? Also it is technically not StringBuffer, so if you want to keep it and you say there are based on string buffer, shouldn't it say "underlying buffer" rather than "this string buffer"? This sentence just sounds like this StringBuilder is somehow a buffer.

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

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

Post by admin »

Yes, I agree.
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 40 guests