Guest User

Untitled

a guest
Oct 21st, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace InheritenceSaga
  8. {
  9. public class A
  10. {
  11. private int val = 10;
  12.  
  13. // nested object you can think of
  14. public class Bnested : A
  15. {
  16. public int GetThatValue()
  17. {
  18. return this.val;
  19. }
  20. }
  21.  
  22. }
  23.  
  24.  
  25.  
  26. public class B : A
  27. {
  28. //public int GetValue()
  29. //{
  30. // // val is inaccsible due to its protection level(Private)
  31. // return this.val;
  32. //}
  33. }
  34. }
Add Comment
Please, Sign In to add comment