Advertisement
Guest User

asdf

a guest
Feb 8th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. package koteczki;
  2. import java.util.Scanner;
  3.  
  4. public class Interfejs {
  5.    
  6.     static Scanner sc = new Scanner(System.in);
  7.    
  8.     public static String getUserInput() {
  9.         return sc.nextLine();
  10.     }
  11.  
  12.     public static void main(String[] args) {
  13.        
  14.         Kot kot = new Kot();
  15.        
  16.         System.out.println("Jak nazywa się kotek?");
  17.        
  18.         kot.setImie(getUserInput());
  19.        
  20.         System.out.println("Twój kotek nazywa się "+ kot.getImie() +"! Jak słodko!");
  21.        
  22.         System.out.println(" ");
  23.        
  24.         System.out.println("Jak nazywa się opiekun kotka?");
  25.        
  26.         kot.setImieOpiekuna(getUserInput());
  27.        
  28.         System.out.println("Oho! Czyli to ty jesteś "+kot.getImieOpiekuna()+"! Bardzo mi miło Ciebie poznać!");
  29.        
  30.  
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement