Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. class Foo {
  2. String getText() {
  3. return "Text from foo";
  4. }
  5. }
  6.  
  7. class Bar extends Foo {
  8. @Override
  9. String getText() {
  10. return "BAR> " + super.getText() + " <BAR";
  11. }
  12. }
  13.  
  14. class Bar {
  15. Foo foo;
  16.  
  17. String getText() {
  18. return "BAR> " + foo.getText() + " <BAR";
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement