I have 3 Questions regarding Oops Concepts:
-
What is the default access modifiers for class in the namespace, i tried to apply modifiers to the class, .net compiler threw error saying `Elements defined in namespace cannot be explicity declared as private, protected or protected friends. below is my code.

-
What is the difference between
protected internal and internalas internal could be used within the assembly, and protected internal could be used in the same class, inherited class or the other classes within the same assembly. and basically what exactly here meant by assembly. - If there is 2 class
Class1 and Class2Class1 hasMethod1()andClass2hasMethod2(), if both are in the inherit chain, thenClass1 c = new Class2();shall allow to accessMethod2();because here the new object is ofClass2then why .net allowsMethod1();i tried this.
1) Internal
2) Either a derived class (potentially in a different assembly) or any code in the same assembly can access
3) You have a reference to a
class1which doesn’t havemethod2– you need a reference to aclass2to be able to callmethod2.