Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Lesson012_28_08_19_Task1 {
- private static Scanner sc = new Scanner(System.in);
- public static void main(String[] args) {
- String name, color, food;
- int whiskersLen, fights;
- Cat c1 = new Cat();
- System.out.println("c1 is: " + c1.toString());
- StreetCat c2 = new StreetCat();
- System.out.println("c2 is: " + c2.toString());
- SiamiCat c3 = new SiamiCat();
- System.out.println("c3 is: " + c3.toString());
- System.out.println("-=-=-=-=-=- New Street Cat -=-=-=-=-=-");
- System.out.print("Please enter new cat's name: ");
- name = sc.nextLine();
- System.out.print("Please enter whiskers hair length: : ");
- whiskersLen = sc.nextInt();
- sc.nextLine();
- System.out.print("Please enter the cat's color: ");
- color = sc.nextLine();
- System.out.print("Please enter number of fights: ");
- fights = sc.nextInt();
- StreetCat cat1 = new StreetCat(name, whiskersLen, color, fights);
- System.out.println("-=-=-=-=-=- New Siami Cat -=-=-=-=-=-");
- System.out.print("Please enter new cat's name: ");
- name = sc.nextLine();
- System.out.print("Please enter whiskers hair length: : ");
- whiskersLen = sc.nextInt();
- sc.nextLine();
- System.out.print("Please enter the cat's color: ");
- color = sc.nextLine();
- System.out.print("Please enter the cat's favorite food: ");
- food = sc.nextLine();
- SiamiCat cat2 = new SiamiCat(name, whiskersLen, color, food);
- System.out.println(cat1.toString() + "\n" + cat2.toString());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement