unity diference protected and virtual

56

unity diference protected and virtual -

public class Father
{
   public virtual void A(){}
   protected virtual void B(){}
}

public class Son:Father
{
   public void C()
   {
     //Here you can access A & B method……
   }
}

Son s = new Son();
s.A();  //You can access this
s.B();  //No!You CANNOT!

Comments

Submit
0 Comments