permaculture playing cards*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Just confirm it... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Just confirm it..." Watch "Just confirm it..." New topic
Author

Just confirm it...

Annie Naqvi
Ranch Hand

Joined: May 04, 2001
Posts: 39
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).]
Mikael Jonasson
Ranch Hand

Joined: May 16, 2001
Posts: 158
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
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Q2 I guess it depends on what is meant by exact location. If exact is a specific x,y coordinate then nullLayout is the only one.
sriram gupta
Ranch Hand

Joined: Aug 09, 2001
Posts: 39
i don't think yield method releases lock... can somebody confirm this??
Christy Smith
Greenhorn

Joined: Aug 15, 2001
Posts: 26
Q1.Which methods release the lock
1.wait() true
2.yeild() true
3.sleep() false
4.notify() false
5.suspend() false
6.stop() true

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
swati bannore
Ranch Hand

Joined: Oct 18, 2000
Posts: 201
Yeah...only wait() releases Lock..


Swati Kale
SCJP
SCWCD
 
GeeCON Prague 2014
 
subject: Just confirm it...