SCJP 6.0 96%
(Connecting the Dots ....)
- Calling wait() inside a non-synchronized method
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
SCJP 6.0 96%
(Connecting the Dots ....)
SCJP6, SCWCD5, OCP-JBCD5, OCE-JWSD6 OCE-JPAD6 , OCM-JEA5 1,OCM-JEA5 2,3,OCJP8 - Brainbench certifications: J2EE, Java2, Java2-NonGUI, JSP, SQL2000 Admin, SQL2000 Programming , Brainbench certified Java Programmer, Computer Programmer, Web Developer, Database Administrator
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
SCJP 6 [86%], OCPWCD [84%], OCEJPAD [83%]
If you find any post useful, click the "plus one" sign on the right
Bert Bates wrote:This is good you guys, but remember that wait(), notify(), and notifyAll() have been removed from the SCJP 6 exam.
Thanks for the encouragement. I wish we could publish a list of such tricks in the appendix of a book or something.
Deepak Bala wrote:
Thanks for the encouragement. I wish we could publish a list of such tricks in the appendix of a book or something.
It looks like a good candidate for a wiki. There is one here that documents trips / traps -> http://faq.javaranch.com/java/ScjpFaq#tripsTraps
You can edit that if you like.
Deepak Bala wrote:There is an edit link on top of the page I mentioned. You can use that to edit the page content.
2. You can shadow variables, but not local variables in a block within the same method.
6. Don't be confused by getting a lock on the Thread itself and getting a lock on the object's method that is being executed.
10. Watch out for trick questions where a constructor is final and thereby no instance can be constructed of it an no other class can subclass the class with a private constructor.
Rajanand P K, Oracle Certified Professional, Java SE 6 Programmer.
By "constructor is final", you mean to declare it as 'private' right - not the java keyword 'final' right?
Kaydell,
Could you please explain the below?
2. You can shadow variables, but not local variables in a block within the same method.
6. Don't be confused by getting a lock on the Thread itself and getting a lock on the object's method that is being executed.
"getting a lock on the thread" == "thread object acts as the monitor" & "getting a lock on the object's method" == ?. We can get a lock on object only; not on its method, right? Or do you mean to say, a synchronized method, where method's object will act as the monitor ? If yes, in that case, is there any behavior difference for the monitor, as compared to the case where the thread object itself act as the monitor ?
What I'm saying is that there is a difference between using an object as a monitor and using the thread as a monitor.
Rajanand P K, Oracle Certified Professional, Java SE 6 Programmer.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |