Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //2ая часть
- public class Fish extends Pet {
- int currentDepth=0;
- public int dive(int howDeep) {
- currentDepth=currentDepth + howDeep;
- System.out.println("Ныряю на глубину " + howDeep + " футов");
- System.out.println("Я на глубине " + currentDepth + " футов ниже уровня моря");
- return currentDepth;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement