static void Main(string[] args) { Console.WriteLine("***** C# CarLibrary Client App *****"); SportsCar viper = new SportsCar("Viper", 40, 240); viper.TurboBoost(); MiniVan mv = new MiniVan(); mv.TurboBoost(); Console.WriteLine("Done. Press any key to terminate"); Console.ReadLine(); var internalClassInstance = new MyInternalClass(); }
static void Main(string[] args) { Console.WriteLine("Press 1 to view Using Private method(Line 87 to 99)"); Console.WriteLine("Press 2 to run Using Protected and Private method(Line 38 to 66)"); Console.WriteLine("Press 3 to run Using Internal method(Line 74 to 82)"); Console.WriteLine("Press 4 to run Using Properties method(Line 108 to 121)"); Console.WriteLine("Go check out my Using Inheritance and Interfaces method(Line 125 to 146) in code"); switch (Console.ReadLine()) { case "1": { Accessibility a = new Accessibility(); a.MyProperty = "Private value changed"; Console.WriteLine(a.MyProperty); break; } case "2": { Derived d = new Derived(); d.MyDerivedMethod(); break; } case "3": { MyInternalClass i = new MyInternalClass(); i.MyMethod(); break; } case "4": { Person p = new Person(); p.FirstName = "John"; Console.WriteLine("Propery value changed to {0}!", p.FirstName); break; } default: { Console.WriteLine("Entered value does not associate with any of the provided options!"); break; } } }
public void DoSomething() { var myInternalClass = new MyInternalClass(); myInternalClass.DoSomething(); }
protected void MyProtectedMethod() { MyInternalClass mic = new MyInternalClass(); mic.ThrowsException(); }
static void Main(string[] args) { var internalClass = new MyInternalClass(); }
public void TestMethod1() { MyInternalClass myclass = new MyInternalClass(); myclass.MyMethod(); }
public MyInternalStruct(MyInternalClass c) { C = c; }
public static void Start() { var internalClass = new MyInternalClass(); internalClass.MyMethod(); }