Advertisement
weeez

Minta2

Apr 7th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. public class Minta2{
  2.    
  3.     int tomb[] = {10,20,30,40,50};
  4.    
  5.     public static void main(String args[]) throws Exception{       
  6.         Minta2 minta = new Minta2();
  7.    
  8.         System.out.println("Hello vilag!");    
  9.        
  10.         int j = 0;
  11.        
  12.         for(int i = 0; i < 5; i++){
  13.             System.out.println(minta.tomb[i]);         
  14.         }      
  15.        
  16.         while( j < 5){
  17.             System.out.println(minta.tomb[j]);         
  18.             j++;
  19.         }
  20.        
  21.         //j = 5
  22.         j = 0;
  23.            
  24.         do{
  25.             System.out.println(minta.tomb[j]);         
  26.             j++;
  27.         }while(j < 5);
  28.  
  29.     }  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement