Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- *
- * @author miljan
- */
- public class TestKlasa2 {
- public static void main(String[] args) {
- System.out.println("Unesite broj pisca: ");
- Scanner ulaz = new Scanner(System.in);
- int n = ulaz.nextInt();
- Pisac niz[] = new Pisac[n];
- Scanner p = new Scanner(System.in);
- for(int j=0; j<n; j++){
- niz[j] = new Pisac();
- }
- for(int i=0; i<n; i++){
- int brojac=i+1;
- System.out.println("Unesite ime " + brojac +". pisca: ");
- String ime = p.nextLine();
- niz[i].setIme(ime);
- System.out.println("Unesite prezime pisca: ");
- String prezime = p.nextLine();
- niz[i].setPrezime(prezime);
- System.out.println("Unesite ID pisca: ");
- String pisacID = p.nextLine();
- niz[i].setPisacID(pisacID);
- System.out.println("Unesite zanr: ");
- String zanr = p.nextLine();
- niz[i].setZanr(zanr);
- System.out.println("Unesite adresu: ");
- String adresa = p.nextLine();
- niz[i].setAdresa(adresa);
- }
- for(int k=0; k<n; k++){
- niz[k].prikazi();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement