Data Hiding

  1. class Mother
  2. {
  3. String x="Mother CLASS";
  4. }
  5. class Beti extends Mother
  6. {
  7. String x="Beti CLASS";
  8. void show()
  9. {
  10. System.out.println(x);
  11. System.out.println(this.x);
  12. System.out.println(super.x);
  13. }
  14. public static void main (String ...a)
  15. {
  16. new Beti().show();
  17. }
  18. }
  19. Output:
  20. Beti CLASS
  21. Beti CLASS
  22. Mother CLASS

| Copyright ©2016 | All Rights Reserved |
| Design by Uves Khan |

Free Web Hosting