예제 #1
0
        static void Main(string[] args)
        {
            SampleClass sampleObject = new SampleClass();

            sampleObject.Sample = "Sample String";
            sampleObject.sampleMethod(1);
            SampleGeneric <string> asdf = new SampleGeneric <string>();

            asdf.Field = "Sample string";
            Container.Nested nestedInstance = new Container.Nested();
        }
예제 #2
0
파일: Program.cs 프로젝트: blaxzoser/OOP
        /// <summary>
        /// Create a generic method
        /// </summary>
        public static void ScenarioOne()
        {
            var a = 10;
            var b = 20;

            Console.WriteLine("Value of a should be A: " + a);
            Console.WriteLine("Value of b should be B:  " + b);
            SampleGeneric.Swap <int>(ref a, ref b);
            System.Console.WriteLine("----------");
            Console.WriteLine("Value of a should be A: " + a);
            Console.WriteLine("Value of b should be B:  " + b);

            // Keep the console open in debug mode.
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
예제 #3
0
        /*------------------------ FIELDS REGION ------------------------*/

        /*------------------------ METHODS REGION ------------------------*/
        public void Main()
        {
            SampleGeneric <Person> sampleGeneric = new SampleGeneric <Person>(
                "Abc", new string[] { "Cde" }
                );
        }