Guest User

Untitled

a guest
Nov 1st, 2017
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 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 laboratorium4;
  7.  
  8. import static java.lang.System.in;
  9. import java.util.Random;
  10. import java.util.Scanner;
  11.  
  12. /**
  13. *
  14. * @author nowak_000
  15. */
  16. public class Zadanie1 {
  17.  
  18. /**
  19. * @param args the command line arguments
  20. */
  21. public static void main(String[] args) {
  22. // TODO code application logic here
  23. zwierzęta z1 = null;
  24. z1.dodaj_zwierze();
  25. zwierzęta z2;
  26. }
  27.  
  28. }
  29. class zwierzęta{
  30. int wiek;
  31. String gatunek;
  32. String imię;
  33. void dodaj_zwierze(){
  34. Scanner in = new Scanner(System.in);
  35. System.out.println("Podaj gatunek: ");
  36. String gatunek = in.nextLine();
  37. System.out.println("Podaj imię: ");
  38. String imię = in.nextLine();
  39. System.out.print("Podaj wiek: ");
  40. int wiek = in.nextInt();
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment