Comment on Tutorial - wait(), notify() and notifyAll() in Java - A tutorial By Jagan



Comment Added by : sumit

Comment Added at : 2014-10-30 08:14:55

Comment on Tutorial : wait(), notify() and notifyAll() in Java - A tutorial By Jagan
You are using "this" to start to the thread before constructor has completed. Isn't it a wrong practice to use incompletely initialize objects by letting them escape before constructor completes-
Producer(Q q) {
this.q = q;
new Thread(this, "Producer").start();
}


View Tutorial



Ask a Question

Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Hi Mounika, The reason to the problem is that you
View Tutorial          By: Ramlak at 2008-04-26 20:06:21

2. Great article. The simple example used easily make
View Tutorial          By: Nikhil at 2009-11-13 08:38:41

3. what if i am running on localhost?
what shd

View Tutorial          By: harish at 2010-02-03 03:47:08

4. thanx allot its a very good sample , but im trying
View Tutorial          By: Waleed Qaffaf at 2011-06-09 09:37:15

5. How can I delete the data that I have entered into
View Tutorial          By: selina at 2011-08-15 05:15:45

6. I need to know the parameters that we need to pass
View Tutorial          By: puru at 2008-09-08 00:33:46

7. This works with inserts but it is very slow for lo
View Tutorial          By: Antonio Pereira at 2011-02-04 08:54:45

8. what about the access modifiers, while talking abo
View Tutorial          By: Seetha at 2010-06-04 01:14:02

9. Thanks
View Tutorial          By: Akhilesh at 2010-04-05 11:31:17

10. why java from two to the power 7 bit was upgraded
View Tutorial          By: avinash at 2013-05-28 08:34:24