Advertisement
virtualideaz

Continue Statement example

Oct 22nd, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1. //
  2. //this is a repitition statement
  3. //
  4. public class RepititionStatements {
  5.     public static void main(String [] args) {
  6.         //this is a continue example
  7.        
  8.         int [] numbers = {10,20,30,40,50};
  9.        
  10.         for (int x : numbers) {
  11.            
  12.             if (x ==30)
  13.             {
  14.                 continue;
  15.             }
  16.             System.out.print(x);
  17.             System.out.print("\n");
  18.         }
  19.     }
  20. }
  21.  
  22. --copy until here--
  23.  
  24. OUTPUT :
  25.  
  26. 10
  27. 20
  28. 40
  29. 50
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement