This week's book giveaway is in the Features new in Java 9 forum.
We're giving away four copies of Java 9 Revealed and have Kishori Sharan on-line!
See this thread for details.
Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What StringBuilder methods are you required to know for OCAJP 8?  RSS feed

 
Shane Jensen
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I did the practice test on this page: http://www.java2blog.com/2016/10/ocajp-8-stringbuilder-mock-questions.html

Some of the StringBuilder methods used in the questions are ensureCapacity() and setLength().

I have been using Mala Gupta's preparation book, and these two methods are not mentioned at all in her book. Am I supposed to know these for the exam? Does anyone know what the complete list of String and StringBuilder methods are you need to know for the exam?

Thank you in advance!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 36622
474
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to know either of those methods for the exam. This is why study guides are useful - they give you a subset of methods to learn.

A tech edited Mala's OCA 7 book and the list of APIs was reasonable. I can't imagine she changed that for the COA 8 edition so go with what is in the book.
 
Shane Jensen
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,

Alright, I thought so. Good to know, thanks!
 
Paul Anilprem
Enthuware Software Support
Ranch Foreman
Posts: 3984
31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Respectfully disagree. You need to know about these two methods. We have seen candidates getting questions on these.
 
Shane Jensen
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Anilprem wrote:Respectfully disagree. You need to know about these two methods. We have seen candidates getting questions on these.

Hi Paul,

Do you know what other String/StringBuilder methods might be tested?
 
Paul Anilprem
Enthuware Software Support
Ranch Foreman
Posts: 3984
31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
StringBuilder

Constructors - all

Methods:
append - all flavors
charAt
delete
indexOf - all flavors
insert - all flavors
lastIndexOf
replace (Compare with String's replace)
reverse
substring
capacity
length
setLength


List of methods in String that can be ignored for the exam -
codePointXXX
all regex related methods such matches

Know that both are final classes. Implications.

HTH,
Paul.
 
Scott Selikoff
author
Bartender
Posts: 4083
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't seen or heard about ensureCapacity() or setLength() either on the exam.  It's not on Jeanne and my study guide, Mala's book, or even K&B's new book. 

Perhaps these are experimental or new questions?  Seems like an odd thing to cover to be honest.
 
Paul Anilprem
Enthuware Software Support
Ranch Foreman
Posts: 3984
31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
StringBuilder's toString as well. Know that StringBuilder overrides Object's toString.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 36622
474
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agreed that toString is important. That's covered in all the study guides.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!