Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.15 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package tablice;
  7.  
  8. /**
  9.  *
  10.  * @author uczen
  11.  */
  12. public class Tablice {
  13.  
  14.     /**
  15.      * @param args the command line arguments
  16.      */
  17.     public static void main(String[] args) {
  18.        /*
  19.         Deklaracja
  20.         typ [] nazwa=new typ[rozmiarTablicy];
  21.         legenda: rozmar tablicy- liczba komórek w tablicy
  22.         */
  23.        String []tksywki=new String[5];
  24.        char []tznaki=new char[4];
  25.        double []tkasa= new double[15];
  26.        int [] trozmiar= new int[16];
  27.        //Samochod []tsamochod=new Samochod[2];
  28.        
  29.        //Dodawanie danych do talicy
  30.        tksywki[0]="siwy";
  31.        tksywki[2]="dziura";
  32.        tksywki[3]="agadul";
  33.        //tksywki[1]="świniak";
  34.        
  35.        for(int i=0; i<tksywki.length;){
  36.            System.out.println(tksywki[i]);
  37.        }
  38.        
  39.        trozmiar[0]=43;
  40.        trozmiar[1]=42;
  41.        
  42.        for(int i=0; i<trozmiar.length; i++){
  43.            System.out.println(trozmiar[i]);
  44.        }
  45.     }
  46.    
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement