How Can You Access A Private Method Of A Class?
Use .Net Reflection. Using reflection we can invoke private methods too. Example: Car car = new Car(); Type type = car.GetType(); MethodInfo methodInfo = type.GetMethod("ShiftGearUp", BindingFlags.NonPublic | BindingFlags.Instance); methodInfo.Invoke(car, null); Pre: Create a class Car with private method "ShiftGearUp"