Advertisement
danzylrabago

protectedinternal

Mar 31st, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. using System;
  2.  
  3. public class Example
  4. {
  5. protected internal int value = 5;
  6. protected internal class MyProtectedInternalNestedClass //nested class
  7. {
  8. public int temp = 4;
  9. }
  10. }
  11.  
  12. class ProtectedInternalExample
  13. {
  14. static void Main()
  15. {
  16. Example Obj = new Example();
  17.  
  18. //the protected internal class and its member is accessible by the current assembly
  19. var obj2 = new Example.MyProtectedInternalNestedClass();
  20. Console.WriteLine("value is: {0}",Obj.value);
  21. Console.WriteLine("temp is: {0}", obj2.temp);
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement