Created
February 19, 2020 21:03
-
-
Save liamkernighan/2cc898ac9220909e90774f3c672a72e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.my.program; // сначала пэкэдж | |
import java.util.*; // Потом глобальные импорты | |
import java.system.*; | |
import com.my.program.animals.Animal; // Через пустую строку локальные импорты | |
import com.my.program.animals.CanWalk; | |
class Cat extends Animal implements CanWalk { | |
@Override | |
void walk(int kilometers) { | |
System.out.println("I'm cat and i'm walking."); | |
} | |
void talk(boolean loud) { | |
if (loud) { | |
System.out.println("I'm talking out loud."); | |
} | |
else { | |
System.out.println("I'm talking quietly."); | |
} | |
} | |
@Override | |
void countPaws() { | |
for (int paw : paws) { | |
System.out.println("Paw number " + paw); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment