Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualburnt_casadilla

Posted 05 August 2012 - 06:10 PM

Why is this giving me an error? it says that the code is unreachable whatever that means

[source lang="java"] public class CreateDOTS extends Thread //create new dots every 10 seconds at random points on the screen
{
public void run()
{
while(true)
{
repaint();
int randomx = (int)(Math.random() * 399 + 1);//create random x
int randomy = (int)(Math.random() * 399 + 1);//create random y
}
try
{
Thread.sleep(5000);
}catch(InterruptedException e){}
}
}[/source

#1burnt_casadilla

Posted 05 August 2012 - 06:02 PM

Why is this giving me an error? it says that the code is unreachable whatever that means

[source lang="java"] public class CreateDOTS extends Thread //create new dots every 10 seconds at random points on the screen { public void run() { while(true) { repaint(); int randomx = (int)(Math.random() * 399 + 1);//create random x int randomy = (int)(Math.random() * 399 + 1);//create random y } try { Thread.sleep(5000); }catch(InterruptedException e){} } }[/source]

PARTNERS