smeacham

OOP Example - Methods

Aug 30th, 2012
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.29 KB | None | 0 0
  1. public class Main1 {
  2.         int rectangle(int h, int w) {
  3.                 return h*w;
  4.         }
  5. }
  6.  
  7. abstract class Main2 {
  8.         abstract int rectangle(int h, int w);
  9. }
  10.  
  11. public class Main3 extends Main2 {
  12.         int rectangle(int h, int w) {
  13.                 return h*w;
  14.         }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment