• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Advice from Fresh New SCJP 1.4 Player

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Fresh on the heels of passing the SCJP 1.4 today with a 97%, thought I'd itemize some nuggets of advice for others eager to pass with high scores.
- WATCH THE WORD QUESTIONS: In every mock exam I took, I was passing the word questions with no problem. It was always the "code example" questions which got me. When it came to the exam, the "word questions" seemed much more subtle and clever (apologies to all mock exam makers). I am sure 1 (if not both) of the questions I got wrong were word questions. Focus on the Collection Framework, Threads, and Garbage Collection (you may think you know it, but give it another thought)
- STUDY WITH A BUDDY: If you can, find someone you can bounce ideas and concepts off on a regular basis. I took the test at the same time as a coworker of mine, and we both scored 95% and above. I am certain we could not have done this without discussing new and interesting tricks and traps at least twice a day for a week prior to the exam. If you must fly solo, find good reliable conversation through this site.
- UNDERSTAND THE TRICKS AND TRAPS: Hone your approach to the tricks and traps you find in mock exams. My approach was to focus on each line of code looking for very specific "triggers" which would remind me of particular tricks and traps I'd found in mock exams. This approach worked wonders for me.
Good Luck,
Doug
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't want to break any confidentiality agreements or anything, but is it possible to expand on what you meant by not really knowing Collections, Threads, and Garabage collection?
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What sorts of "triggers" do you look for in questions with code?
 
Doug Newcomb
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't have much time right now, but I'll try to elaborate some more on the points I described.
About the "word" questions, I'll let you know what I would have spent more time on (and why) if I were to take the test over again.
Collection Framework: It's not good enough to know which concrete collection class type to use. It's ok given a scenario like ...
Q:"Which collection class is best suited when you want to keep track of a list of types of german beer in alphabetical order"
A:"TreeSet" - "Tree" for the alphabetical (natural order) part of the description, and "Set" for the uniqueness implied by the word "types" above.
... more subtly, What would be the answer if the question were...
"Which Collection type is best suited when you want to keep track of a list of types of german beer in alphabetical order".
...In this question, collection was turned into Collection [upper case], and the word class was removed. Now the question is asking which interface, inheriting from Collection, is best suited for...". A subtle difference, but don't fall for it. In this last case the answer could be "Set" or "SortedSet" depending on which choices are available. There are a myriad of different subtle scenarios like this. "K & B" points out all the "triggers" you would need to catch this in Chapter 7, I would have spent more time here.

Threads: It is soooo very important to understand what state changes a thread makes depending upon different events such as ...
- A call to join().
- A call to wait().
- An overloaded wait() call times out on an object.
- when the lock on the object has already been released.
- when the lock on the object is still held.
- Many many more scenarios change thread state.
I would have spent more time constructing state flow diagrams for the different scenarios.
I've gotta go, I'll answer more later.
[Some time later]
TRIGGERS:
While taking mock exams, I found that I would miss many "example code" questions not because I didn't understand the material, but because I had glossed over an easy-to-miss syntax or logic error. I called them "stupid" errors [stupid on my part, absolutely not on the part of the exam makers]. I realized that I would probably fall for the same error more than once if I just told myself "Don't do that again!". I decided to construct a list of reminders in code form (triggers) to remind me to look for the ever present TRICK.
What I mean by trigger is: A small identifiable piece of code that instinctively makes you look for a trick (like Pavlov's dog). By writing down a list of code items, and associated tricks to look out for, you have the opportunity to focus on your weaknesses in nice bite sized chunks.
This is just an approach that worked for me, and everyone is different, so your approach might be different as well. If you haven't formulated an approach to these "stupid" errors, then you might want to try this one on for size.
Here are a few of the triggers and associated Tricks I used to help me for the exam (in every case, I missed a mock exam question due to the same stupid error that I eventually got correct on the real thing).
- wait(), join(), sleep() : Look for try/catch block to catch InterruptedException.
- case: x : Look for x as non-final variable... Compiler error.
- [top level class] : Look for any other access modifier besides public and [default access]... Compiler error.
- [anonymous, method-local, inner class] : Look for semi-colon at closing bracket. If not there... Compiler error.
- ["final" base class method] : Look for shadowing in child method, access from child method.
- [Wrapper Class].[Any Method] : SUPER CLOSE SCRUTINY! could be NFE Error, incorrect return type.
If you attempt to follow this approach it is important to know the material, and read books before you attempt to make a list, otherwise your list will be cumbersome.
I hope this helps,
Doug
[ June 17, 2003: Message edited by: Doug Newcomb ]
[ June 17, 2003: Message edited by: Doug Newcomb ]
[ June 18, 2003: Message edited by: Doug Newcomb ]
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I tried this one:
- [top level class] : Look for any other access modifier besides public and [default access]... Compiler error.
You're right, but I don't know why this happens.
And I can't find it anywhere? (is it too simple?)
Pls. tell me why an outer class can not be
private, protected, even static?
Thanx.
DD
 
Brian Joseph
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Doug for expanding on that.
 
Brian Joseph
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey, I have a question about this one:


- [non-anonymous, method-local, inner class] : Look for semi-colon at closing bracket. If not there... Compiler error.


Correct me if I'm wrong. This isn't required. I can create a local class without a semi-colon, and definately a member class is ok without one. Only an anonymous class requires a semicolon, because it's basically like an extended version of the new statement.
 
Doug Newcomb
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Brian,
Meant to say "anonymous" instead of "non-anonymous". Sorry about the confusion. I've changed it so it should be ok now.
BTW if it IS "non-anonymous" and "method-local", then you cannot construct an instatiation of the class until AFTER the class declaration, so you must NOT have a semi-colon after the class declaration, as you pointed out.
Also, the semi-colon rule only applied if the anonymous, method-local inner class in NOT declared inside the aurgument list of another method call.
Good catch Brian, I'll be more careful in the future!!!
Cheers,
Doug
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Denes Doma:
Hi!
I tried this one:
- [top level class] : Look for any other access modifier besides public and [default access]... Compiler error.
You're right, but I don't know why this happens.
And I can't find it anywhere? (is it too simple?)
Pls. tell me why an outer class can not be
private, protected, even static?
Thanx.
DD


There can only have 2 types of access modifiers for the outer classes: default and public.
Default access gives you package level access, and the class is visible to any other class in the same package.
Public access gives you package level access, but also allows other classes in other packages to see it.
If you don't want a class to be seen by other classes in the same package, put it in another package and give it default access. But don't give it a private or protected access modifier.
If you don't want other classes to inherit from your class, declare it as final. You can combine this modifier with the default and public modifiers.
I don't know what it means for a class to be declared as "static". As far as I know there is no such thing. Inner classes are declared as "static" not because the class is static, but because it is a static member of the outer class.
I hope this helps. Have a nice day.
[ June 18, 2003: Message edited by: M Huang ]
 
Denes Doma
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. Thanks for your help!
I was misled by thinking only in outer class - inner class.
I see that NO 'normal' class can be private or protected.
BYE
DD
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic