Hey there all you ranchers, I'm not new to this wonderful website, I've just been watching from the sidelines reading a lot of peopl'es success storie. I wanna make my own history too, and share with you all. I'll be taking my exam in 3 days time(SCJP 5.0), and the only objective I'm a bit weary of is API contents. i have no idea how far the exam will go in this regard as well as being able to distinguish between classes through their API's (e.g Like what methods could be both in StringBuffer and String) as in some mock exams. I have tried my best to master these through coding and mock exams, but the truth is you can never know all of them off hand, and worse still for the exam. I took several mock exams, whizlabs, Devankas exam lab(wonderful simulator, thanks there), have downloaded the master exam too. All i need to do now are the final exams in all these simulators and polish up on my preparation. Any help, tips advice??
I've been struggling with API classes as well and for me I've found that flash cards have been a great way to learn em.
I don't go crazy trying to memorize every single method/constructor call for every File, StringBuffer, PrintWriter, Locale, etc but after writing the card and then going back over it a few days later I find that I can remember about 80% of what I wrote down. It makes noticing a bogus line of code on a question much easier to spot.
Also, I think it is important to recognize what the question you are looking at is testing you on. For instance, if the question is using threads and synchronization then they may try and slip you up with false locks, running a thread more than once, or such but they most likely won't misuse a String method right in the middle of it all. That's been my experience anyways, and so knowing that you only need to concentrate on the API material when the question is directly testing you on this knowledge. Can you create a File object with 2 Strings as parameter? These are the kinds of things that I find flash cards are a great way to do a last min cram before the exam.
This could be an interesting discussion. Given that we're discussing the API classes listed in the objectives, I can tell you that the intention of the exam creation team was that candidates would know the following:
- how to use the docs - the common ways to construct API objects - the main uses of the API classes and the main ways the related ones differ from one another - the common ways to use the API classes
I would posit if you really know the stuff listed above you can score at least 80% on the API parts of the exam. I hope that most of the API questions in our book can be reverse-engineered based on the above. I would further guess that a lot of the other mocks out there demand a higher degree of memorization than is necessary. In other words, unless you're dying to get an incredibly high score, you can probably reduce a lot of your memorization effort and still score comfortably well in these areas.
What might be interesting would be to look at specific mock exam questions and see how well they fit into the list above. If ranchers want to post examples, I'd be happy to discuss how well I think the questions match what you really need to know.
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
posted 11 years ago
I think the main challenge with API is just the vast amount of classes and material that's there. There is a ton of it and there are some very small nuances that are hard to remember. I try to focus on the main ideas behind each class and how they are related, this makes it easier to detect code that just doesn't make since. Some things you just have to memorize though, like creating a File object does not create an actual file. Beyond that I think there are to many major things on the exam like multithreading and generics that are much more important to understand fully. When you want to do real code with API classes like Local and such I think I would just refer to the javadocs instead of my memory.
~Currently preparing for SCJP6
posted 11 years ago
i have gone through quite a number of questions that i didn't know the answers to then , that i know now. But I'm thinking of a scenario where I could come across a new question in the exam regarding API's , I'm not sure I could get that correct. For example, When I came across the following questions, first time, i struggled
1. Which methods are found in Both String and Patter classes (Answer split(), and toString()) 2. Which methods are common to String and StringBuffer from the following a. toUppercase b. substring c. charAt b. trim (Answer b an c, they both have toString() as well) 3. Classes like Integer, Date, File implement the Comparable inteface true/false? (Answer true)
Now my question is not the above questions, I don't know how to handle questions that would discuss methods I might not know. What is the probabilty, because I think SCJP is quite demanding and going through the API docs is another thing altogether.I hope I am making sense guys. Am taking exam in 3 days time, and isuues in the API docs are all immense
thanks, Levi Raymond
posted 11 years ago
Sorry the guys , the first question is meant to be 1. Which methods are found in Both String and Pattern classes (Answer split(), and toString())
Well as far as I think, I would divide API into two parts (this is what I fell and others may disagree).
Collections Other APIs (IO, Parsing and Formatting & wrappers)
I think you don't need to memorize the collections API. You must just be clear about what are the benefits of each type of collections. Apart from that, you must know the methods of each collection. There are a few gotchas here as I feel.
-LinkedList supports both List and queue related methods -subSet(startInclusive, endExclusive) -in the same manner headSet(endExclusive) and tailSet(startInclusive). -(there are a few more of them but I don't remember them so I will update it when I have my K&B book with me)
You don't need to memorize them though. What you need is just a bit practice.
Now coming to IO. I think that is a pretty straight forward thing. You just need to know File class, Writer classes and Reader classes. I didn't had any trouble with this part (including serialization). Just remember a few gotchas
-BufferedWriter and BufferedReader can only be created using a Writer and Reader only. -Since you are going for the 5.0 exam, so PrintWriter is also only instantiated using a Writer (I may be wrong here). -FileReader and FileWriter work on char and int. -renameTo method in File class takes a File object as parameter.
Serialization is simple. Just read K&B and you will be all clear.
In the wrapper classes, I don't think there is much to worry. I found these gotchas in them
-Float constructor can take a double -Character constructor cannot take a String -Double and Float cannot take a Radix parameter while parsing a String. -toString can take a Radix only in Integer and Long.
I don't know whether the exam can go into such details, but I found these pitfalls hard to spot.
String, StringBuffer and StringBuilder also have a few pitfalls. StringBuffer and StringBuilder are the same so I will only mention StringBuffer here
-StringBuffer doesn't override equals method. -StringBuffer's substring method returns a new String object. -String's replace method takes two char parameters.
In formatting, I feel there are these pitfalls
-DateFormat.getInstance cannot take any parameter. You will have to use DateFormat.getDateInstance for that -NumberFormat.getInstance and NumberFormat.getNumberInstance are the same i.e. both can be used interchangeably. -You cannot change the locale of NumberFormat or DateFormat after you create their instance (this is clearly stated in K&B)
I may have overlooked a few things as I don't have my book with me where I have pointed out every pitfall. I will update this post next time ...
Thank you all, Bert, Ankit, all you who gave me useful tips. I just cleared SCJP. Will post the details in another forum. I actually scored the highest in API Contents, how ironic, however it turned out to be at the expense of the other sections. But never the less I's so proud of myself today. I'm here on Javaranch to stay hey, because now it's SCDJWS. it's a sucess story for me guys Thanks again
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad: