dzieciol

Java ćwicznia2

Mar 3rd, 2017
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.01 KB | None | 0 0
  1. //import java.util.*;
  2.  
  3. package javaapplication2;
  4.  
  5.  
  6. public class JavaApplication2 {
  7.  
  8.     /**
  9.      * @param args the command line arguments
  10.      */
  11.     int iloscArgumentow;
  12.     String[] args;
  13.    
  14.    
  15.     public static void main(String[] args) {
  16.         JavaApplication2 app =new JavaApplication2(args);
  17.         app.wyswietlParametry(args);
  18.         app.przypisanie(args);
  19.        
  20.        
  21.        
  22.     }
  23.     JavaApplication2(String[] args){
  24.         iloscArgumentow = args.length;
  25.         System.out.println(iloscArgumentow);
  26.        
  27.        
  28.     }
  29.     void wyswietlString(String arg){
  30.         System.out.println(arg);                    
  31.     }
  32.     void wyswietlParametry(String[] args){
  33.         for(int i=0; i<iloscArgumentow;i++){
  34.             wyswietlString(args[i]);
  35.         }
  36.     }
  37.     void przypisanie(String[] args){
  38.         String[] tablicaStringow =new String[5];
  39.         for(int i=0; i<iloscArgumentow;i++){
  40.             tablicaStringow[i]=args[i];            
  41.         }
  42.     }
  43.    
  44. }
Add Comment
Please, Sign In to add comment