About Question enthuware.ocajp.i.v7.2.1304 :
Moderator: admin
-
- Posts: 1
- Joined: Thu Apr 11, 2013 5:10 am
- Contact:
About Question enthuware.ocajp.i.v7.2.1304 :
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!
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!
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1304 :
I see that it is marked as incorrect.
HTH,
Paul.
HTH,
Paul.
-
- Posts: 21
- Joined: Mon Nov 20, 2017 8:00 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1304 :
What exactly we should know about StringBuilder class? I've never seen and/or used setLength method, for example.
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
-
- Posts: 3
- Joined: Thu Jun 11, 2020 4:17 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1304 :
Hi,
Am I missing something?
There are 2 correct answers trim() and setLengght(), but only one is marked as correct.Am I missing something?
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1304 :
No, there is only one correct option i.e. option 1.
Please read the question carefully. It says "NOT part of".
Please read the question carefully. It says "NOT part of".
Re: About Question enthuware.ocajp.i.v7.2.1304 :
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.
Javadoc of setLenght in AbstractStringBuilder doesn't mention neither string builder not buffer.
Sets the length of the character sequence.
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1304 :
Both StringBuilder and StringBuffer are based on an internal "buffer" of characters or character sequence. The description is applicable to both.
Re: About Question enthuware.ocajp.i.v7.2.1304 :
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.
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1304 :
Yes, I agree.
Who is online
Users browsing this forum: No registered users and 20 guests