Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 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.
- */
- package laboratorium4;
- import static java.lang.System.in;
- import java.util.Random;
- import java.util.Scanner;
- /**
- *
- * @author nowak_000
- */
- public class Zadanie1 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- zwierzęta z1 = null;
- z1.dodaj_zwierze();
- zwierzęta z2;
- }
- }
- class zwierzęta{
- int wiek;
- String gatunek;
- String imię;
- void dodaj_zwierze(){
- Scanner in = new Scanner(System.in);
- System.out.println("Podaj gatunek: ");
- String gatunek = in.nextLine();
- System.out.println("Podaj imię: ");
- String imię = in.nextLine();
- System.out.print("Podaj wiek: ");
- int wiek = in.nextInt();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment