понедельник, 5 декабря 2016 г.

level05.lesson12.home03

package com.javarush.test.level05.lesson12.home03;

/* Создай классы Dog, Cat, MouseСоздай классы Dog, Cat, Mouse. Добавь по три поля в каждый класс,
 на твой выбор. Создай объекты для героев мультика Том и Джерри.
 Так много, как только вспомнишь.Пример:Mouse jerryMouse = new Mouse(“Jerry”, 12 , 5), 
где 12 - высота в см, 5 - длина хвоста в см.*/
import com.javarush.test.level05.lesson09.task02.Cat;

public class Solution
{
    public static void main(String[] args)
    {
        Mouse jerryMouse = new Mouse("Jerry", 12 , 5);
        Cat Tom = new Cat("Tom", 11 , 20);
        Dog dog1 = new Dog("Pes", 12 , 21);

        //напишите тут ваш код    }

    public static class Mouse
    {
        String name;
        int height;
        int tail;

        public Mouse(String name, int height, int tail)
        {
            this.name = name;
            this.height = height;
            this.tail = tail;
        }
    }
    public static class Dog
    {
        String name;
        int height;
        int tail;

        public Dog(String name, int height, int tail)
        {
            this.name = name;
            this.height = height;
            this.tail = tail;
        }
    }
    public static class Cat
    {
        String name;
        int height;
        int tail;

        public Cat(String name, int height, int tail)
        {
            this.name = name;
            this.height = height;
            this.tail = tail;
        }
    }

    //добавьте тут ваши классы
}

Комментариев нет:

Отправить комментарий