MkArs

dz1.2

Oct 28th, 2016
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. package Pet;
  2.  
  3. public class Fish {
  4.  
  5. class fish extends Pet {
  6. int currentDepth = 0;
  7. public int dive(int howDeep) {
  8. currentDepth = currentDepth + howDeep;
  9. System.out.println("diving to" + howDeep + "feets depth");
  10. System.out.println("I am at the depth" + currentDepth + "under the sea");
  11. return currentDepth;
  12. }
  13. }
  14. }
Add Comment
Please, Sign In to add comment