Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package LatihanPolymorphism;
- class MyParent {
- int x, y;
- MyParent(int x, int y) {
- this.x = x;
- this.y = y;
- }
- public int addMe(int x, int y) {
- return this.x + x + y + this.y;
- }
- public int addMe(MyParent myPar) {
- return addMe(myPar.x, myPar.y);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment