English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

public class Flags2 {
private boolean isReady = false;
public ______ void produce() {
isReady = true;
_______ ;
}
public ______ void consume() {
while(!isReady) {
try {
______ ;
}
catch(Exception ex) { }
}
isReady = ______ ;
}
}

Hints ::
synchronized
true
false
wait()
volatile
synchronized()
notifyAll()
synchronize

2006-08-28 21:22:14 · 4 answers · asked by K Ban 2 in Computers & Internet Programming & Design

Tiwari ji, fill the underlines with hints below.
Repetition is also allowed.

2006-08-28 21:51:42 · update #1

public class Flags2 extends Thread{
private boolean isReady = false;
public synchronized void produce() {
isReady = true;
notifyAll();
}
public synchronized void consume() {
while(!isReady) {
try {
wait();
}
catch(Exception ex) { }
}
isReady = false;
}
public static void main(String[] args) {
Flags2 f = new Flags2();
}
}

2006-08-28 22:21:56 · update #2

4 answers

synchronized
notifyAll()
synchronized
wait()
false

2006-08-28 21:59:25 · answer #1 · answered by Bruno 3 · 0 0

When ever you ask Question Try to make it understandable wo that other could help you

For Shake of your undestanding I give a Simple Example
Most Stupid Question

I got Mail from My Girlfriend
!@##$@#$%^4
2#$%@#$%
%^$%
This is a encryptated one Can any one Solve it

Means You Can get What I want to say you.
This is a Matter of me and My Girl friend.Its own process and we know How to encrypt and decrypt it.
Unless One Know What the algo we are using its a Hard process to know?


Means You are in the Process And We are Helping from out side the Process.That why Programmer Should Think of Documentation
So Kindly post your question what you want to ask. And Why you need this Code.where you are going to use this code.
There Might be Chances You will get most suitable answer

I don't want to hurt you.I guess you get what I said
Regards
Alok Tiwari
India

2006-08-29 04:37:42 · answer #2 · answered by mralokkp 3 · 0 0

Do What????????????????????????????? Not getting this one at all!

2006-08-29 04:27:43 · answer #3 · answered by soniaatcalifornia 5 · 0 0

WTF

2006-08-29 04:27:30 · answer #4 · answered by want2wild 5 · 0 0

fedest.com, questions and answers