Click here to Skip to main content
15,929,653 members
Home / Discussions / Java
   

Java

 
QuestionVPN project tips?? Pin
Strategic_Thinker20-Apr-10 6:41
Strategic_Thinker20-Apr-10 6:41 
AnswerRe: VPN project tips?? Pin
Richard MacCutchan20-Apr-10 11:06
mveRichard MacCutchan20-Apr-10 11:06 
GeneralRe: VPN project tips?? Pin
Strategic_Thinker22-Apr-10 4:12
Strategic_Thinker22-Apr-10 4:12 
GeneralRe: VPN project tips?? Pin
Richard MacCutchan22-Apr-10 5:51
mveRichard MacCutchan22-Apr-10 5:51 
GeneralRe: VPN project tips?? Pin
Paul Conrad22-Apr-10 6:21
professionalPaul Conrad22-Apr-10 6:21 
GeneralRe: VPN project tips?? Pin
Strategic_Thinker22-Apr-10 6:29
Strategic_Thinker22-Apr-10 6:29 
GeneralRe: VPN project tips?? Pin
Richard MacCutchan22-Apr-10 6:33
mveRichard MacCutchan22-Apr-10 6:33 
GeneralRe: VPN project tips?? Pin
Paul Conrad22-Apr-10 6:36
professionalPaul Conrad22-Apr-10 6:36 
GeneralRe: VPN project tips?? Pin
Strategic_Thinker22-Apr-10 6:44
Strategic_Thinker22-Apr-10 6:44 
GeneralRe: VPN project tips?? Pin
Paul Conrad22-Apr-10 7:01
professionalPaul Conrad22-Apr-10 7:01 
GeneralRe: VPN project tips?? Pin
Strategic_Thinker22-Apr-10 7:04
Strategic_Thinker22-Apr-10 7:04 
GeneralRe: VPN project tips?? Pin
Strategic_Thinker22-Apr-10 6:57
Strategic_Thinker22-Apr-10 6:57 
GeneralRe: VPN project tips?? Pin
Paul Conrad22-Apr-10 6:34
professionalPaul Conrad22-Apr-10 6:34 
GeneralRe: VPN project tips?? Pin
Strategic_Thinker22-Apr-10 6:35
Strategic_Thinker22-Apr-10 6:35 
GeneralRe: VPN project tips?? Pin
Paul Conrad22-Apr-10 6:43
professionalPaul Conrad22-Apr-10 6:43 
Questioninserting byte array into mysql DB Pin
Evgeni5720-Apr-10 0:06
Evgeni5720-Apr-10 0:06 
AnswerRe: inserting byte array into mysql DB Pin
David Skelly20-Apr-10 1:52
David Skelly20-Apr-10 1:52 
QuestionPlacing a label inside a label using swing Pin
PJanaki19-Apr-10 19:01
PJanaki19-Apr-10 19:01 
AnswerRe: Placing a label inside a label using swing Pin
TorstenH.20-Apr-10 23:42
TorstenH.20-Apr-10 23:42 
GeneralRe: Placing a label inside a label using swing Pin
PJanaki21-Apr-10 23:53
PJanaki21-Apr-10 23:53 
QuestionWait and Notify Issue.. Pin
sujan.vb.net19-Apr-10 15:22
sujan.vb.net19-Apr-10 15:22 
public class Interference extends Thread {

	/**
	 * @param args
	 */
	String name;
    static boolean isZero = true;
    static int counter = 0;
    public static void main(String arg[]) {
    	
    	MyThread m = new MyThread();
    	m.setName("Important Thread");
    	m.start();

			synchronized(m){
				    	try {
				    		System.out.println("Waiting for " + m.getName() + " to Complete....");
							m.wait();
						} catch (InterruptedException e) {
							
							e.printStackTrace();
						}
			}
        System.out.println("Main Work Started");
        System.out.println("Hello");
    }
   
    Interference(String nameString) {
        name = nameString;
    }
    public void run() {
    	System.out.println(name + " Started....");
        for(int i=0; i<100000000; i++) {
            if(isZero) {
                isZero = false;
                counter++;
            } else {
                isZero = true;
                counter--;
            }
        }
        System.out.println(name + ": " + counter);
    }

}

class MyThread extends Thread
{
	public void run()
	{
		System.out.println(Thread.currentThread().getName()+" : Let me finish first !");
		Interference inter = new Interference("NEW");
		inter.start();
		try {
			inter.join();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		for(int i =0;i<1000;i++){}
		System.out.println(Thread.currentThread().getName()+" : OK! do your work now");
			
	}
}


The above code demonstrates a wait and notify scenario but I have not notified the object after MyThread's work finishes. I'm amazed that without notifying, how the wait() breaks. can anybody explain me.
AnswerRe: Wait and Notify Issue.. Pin
David Skelly20-Apr-10 2:09
David Skelly20-Apr-10 2:09 
QuestionHeap Size in Windows7 ? Pin
002comp18-Apr-10 22:55
002comp18-Apr-10 22:55 
AnswerRe: Heap Size in Windows7 ? Pin
Richard MacCutchan19-Apr-10 1:28
mveRichard MacCutchan19-Apr-10 1:28 
GeneralRe: Heap Size in Windows7 ? Pin
002comp19-Apr-10 2:02
002comp19-Apr-10 2:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.