Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-18-2008, 09:57 AM
Member
 
Join Date: Sep 2008
Posts: 4
abhinav_jain09 is on a distinguished road
challanging question
4
Public class Geo{
Public static void main(String [] args){
Geo g=new Geo();
final Object o1 = new Object();
fnal Object o2= new Object();
thread tx = new Thread (new Runnable(){
public void run(){
synchronized (o1){
synchronized (o2){
calc();
}
}
}
});

thread ty = new Thread (new Runnable(){
public void run(){
synchronized (o1){
synchronized (o2){
calc();
}
}
}
});
tx.start();
ty.start();
}
}
Which of the following about the geo.java program is true?
a) an exception can occur because of two threads.
b) The program contains invalid synchronize statements.
c) A deadlock situation can occur with the two threads.
d) The program is constructed in a way that will avoid deadlock.
Ans;-



also answer the question in attachment file
Attached Files
File Type: txt java_question.txt (5.1 KB, 2 views)

Last edited by abhinav_jain09 : 09-18-2008 at 10:29 AM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-18-2008, 11:04 AM
Senior Member
 
Join Date: Jun 2008
Posts: 481
masijade is on a distinguished road
Hardly. Stop cross-posting/flooding the forum with this question. No one is going to do your homework/test for you. You'd do better to study next time.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 09-18-2008, 11:06 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,609
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Seems that we have a mess with homework here. Please keep in mind that better try something first yourself and if you stuck ask any question. Definitely we help to solve your issues. But no one here for doing your homework.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question mark colon operator question orchid Advanced Java 8 11-27-2008 08:36 AM
question zizou147 New To Java 13 07-04-2008 09:05 PM
question on jsp munigantipraveen JavaServer Pages (JSP) and JSTL 2 06-30-2008 04:47 PM
Need help on this question Deon New To Java 3 01-27-2008 05:58 PM
Need help with a question please sonal New To Java 1 11-29-2007 11:17 PM


All times are GMT +3. The time now is 08:37 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org