Guest User

Untitled

a guest
Mar 17th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. class A
  2. {
  3. int i = 1;
  4. public int print()
  5. {
  6. System.out.println(" z klasy A ");
  7. return i;
  8. }
  9. }
  10. public class B extends A
  11. {
  12. int i = 2;
  13. public int print()
  14. {
  15. System.out.print(" z klasy B ");
  16. return i;
  17. } public static void main(String[] arg)
  18. {
  19. A a = new B();
  20. System.out.println("i " + a.print()); }
  21. }
Add Comment
Please, Sign In to add comment