• 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

Just confirm it...

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i don't think yield method releases lock... can somebody confirm this??
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah...only wait() releases Lock..
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic