Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace InheritenceSaga
- {
- public class A
- {
- private int val = 10;
- // nested object you can think of
- public class Bnested : A
- {
- public int GetThatValue()
- {
- return this.val;
- }
- }
- }
- public class B : A
- {
- //public int GetValue()
- //{
- // // val is inaccsible due to its protection level(Private)
- // return this.val;
- //}
- }
- }
Add Comment
Please, Sign In to add comment