The Artima Developer Community
Sponsored Link

Java Answers Forum
java

4 replies on 1 page. Most recent reply: Aug 3, 2004 7:11 AM by Jeroen Wenting

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 4 replies on 1 page
Senthoorkumaran Punniamoorthy

Posts: 335
Nickname: senthoor
Registered: Mar, 2002

java Posted: Jul 30, 2004 12:26 AM
Reply to this message Reply
Advertisement
import java.io.File;
 
public class LoopSpike {
  public LoopSpike() {
  }
  public static void main(String[] args) {
    File f = new File("test.txt");
    while (true){
      f.exists();
//      try {
//        Thread.sleep(1);
//      }
//      catch (InterruptedException ex) {
//      }
    }
  }
}


Jeroen Wenting

Posts: 88
Nickname: jwenting
Registered: Mar, 2004

Re: java Posted: Jul 30, 2004 2:29 AM
Reply to this message Reply

public class LoopSpike
{
public static void main(String args[])
{
while (true){}
}
}


does exactly the same without causing any load on the filesystem :)

Jeroen Wenting

Posts: 88
Nickname: jwenting
Registered: Mar, 2004

Re: java Posted: Jul 30, 2004 2:30 AM
Reply to this message Reply
now why don't those code tags work?

mausam

Posts: 243
Nickname: mausam
Registered: Sep, 2003

Re: java Posted: Aug 3, 2004 7:07 AM
Reply to this message Reply
what is this for?

Jeroen Wenting

Posts: 88
Nickname: jwenting
Registered: Mar, 2004

Re: java Posted: Aug 3, 2004 7:11 AM
Reply to this message Reply
eternal loop, looks like.
If not there's something seriously wrong with his code.

Flat View: This topic has 4 replies on 1 page
Topic: Transaction Handling(in  EJB) Previous Topic   Next Topic Topic: java.servlet.servletexception

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use