Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Pet;
- public class Fish {
- class fish extends Pet {
- int currentDepth = 0;
- public int dive(int howDeep) {
- currentDepth = currentDepth + howDeep;
- System.out.println("diving to" + howDeep + "feets depth");
- System.out.println("I am at the depth" + currentDepth + "under the sea");
- return currentDepth;
- }
- }
- }
Add Comment
Please, Sign In to add comment