Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Q1.Which methods release the lock 1.wait() true 2.yeild() true 3.sleep() false 4.notify() false 5.suspend() false 6.stop() true Q2.which layout can position components at exact location 1.null layout (t) 2.cardlayout (f) 3.setlayout (f) 4.borderlayout (t) 5.GridLayout (t) 6.GridBagLayout (t)
Q3.Which of following statments are true a: If object obj1 is accessible from object obj2 and object2 is accessible from obj1, then obj1 and obj2 are not eligible for garbage collection. (False) b: If an object obj1 can access an object obj2 that is eligible for garbage collection, then obj1 is also eligible for garbage collection.(False) c:Object will not be destroyed until they have no references to them (True) d: If an exception is thrown during excution of the finalize method of an object,then the exception is ignored and the object is destroyed.(True) Plz guys correct me if i am wrong... Regards, Annie.
[This message has been edited by Annie Naqvi (edited August 17, 2001).]
Q2: Borderlayout & Gridlayout doesn't let you specify the exact location, since the size of each windowpart has to do with the size of the window. I think GridBag does the same, but don't know enough about gridbag to know for sure. Q3: a) This depends on what they mean by "accessible". If they mean "can call methods in THAT particluar object", then the statement is true, since you need a reference to call the methods, thus both are referenced... b) How is that even possible? See a) d) Not sure. Don't really know about the finalize... /Mike
I think wait() is only one that releases the lock. yield() is not executed in the synchronized environment. stop() kills the thread which might release the lock but it is deprecated in Java2 (I think). Please correct me if I am wrong