Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package koteczki;
- import java.util.Scanner;
- public class Interfejs {
- static Scanner sc = new Scanner(System.in);
- public static String getUserInput() {
- return sc.nextLine();
- }
- public static void main(String[] args) {
- Kot kot = new Kot();
- System.out.println("Jak nazywa się kotek?");
- kot.setImie(getUserInput());
- System.out.println("Twój kotek nazywa się "+ kot.getImie() +"! Jak słodko!");
- System.out.println(" ");
- System.out.println("Jak nazywa się opiekun kotka?");
- kot.setImieOpiekuna(getUserInput());
- System.out.println("Oho! Czyli to ty jesteś "+kot.getImieOpiekuna()+"! Bardzo mi miło Ciebie poznać!");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement