How to make a method thread safe without using synchronized
keyword?
Answer Posted / venkat
Hi Jitender,
Here the scnroniziation is happening in methodA(){}
But the same thread(Thread-0) is executing even second time
also. Could you please clarify the same.
Here is the output.
Constructor..
Thread started..Thread-0
processing....Thread-0
Thread started..Thread-1
complete..Thread-0
processing....Thread-0
complete..Thread-0
Regards,
Venkat
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
when a request is generated from apache tomcat 5.5 and goes to oracle 10g or mysql,,, how the oracle or mysql reads the request as apache is a web server and oracle 10g is application server? when the oracle 10g provides response, how the apche tomcat reads it???
Explain about the security aspect of java?
What is unicode used for?
What is a bufferedreader?
How are this() and super() used with constructors in java programming?
Which eclipse is best for java?
How can a gui component handle its own events in java programming?
How many boolean functions are there?
Which package is always imported by default?
Difference between notify() method and notifyall() method in java?
What is the major drawback of internal iteration over external iteration?
Which class is the superclass of all classes?
What is static method with example?
How do you get length in java?
What is the difference between method overriding and overloading?