Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

thread implements Runnable

public  class AutreBateau  implements Runnable {
   
    // implémentation de la méthode run() de l'interface Runnable
    public  void run() {
      
       int n =  0 ; 
       while (n++ <  100) {
         System.out.println("Je vogue aussi !") ;
          try {
      
            Thread.sleep(10) ;
         }  catch (InterruptedException e) {
         
             // gestion de l'erreur
         }
      }
   }
}
Source by blog.paumard.org #
 
PREVIOUS NEXT
Tagged: #thread #implements #Runnable
ADD COMMENT
Topic
Name
1+5 =