static void Lesson11() { Lesson11 mylesson11 = new Lesson11(); mylesson11.SampleLesson11(); mylesson11.UseParams2(10, 3, 36, 45, 120); int[] intArray = { 2, 3, 4, 5, 6 }; mylesson11.UseParams(intArray); mylesson11.UseParams2(1, "Happy", false, 34.5F); mylesson11.OptionalParam("Alex"); mylesson11.OptionalParam("Alex", 19); int test = 14; mylesson11.RefSample(ref test); //String myTestName, myTestSecondName; mylesson11.OutSample("John Doe Riley", out string myTestName, out string myTestSecondName, out string middle); // Console.WriteLine(myTestName); Console.WriteLine(myTestName + ", " + myTestSecondName); Console.WriteLine(middle); // Output - myTestName = John & mySecondName = Doe // mylesson11.OutSample("John Doe", out string first, out string second); //Console.WriteLine(first); // Console.WriteLine(second); }
static void OutSample() { String myTestName, myTestSecondName; Lesson11 mylesson = new Lesson11(); mylesson.OutSample("John Doe", out myTestName, out myTestSecondName); Console.WriteLine(myTestName); Console.WriteLine(myTestSecondName); // Output - myTestName = John & mySecondName = Doe }
static void ModifierExamples() { int test = 14; Lesson11 myLesson = new Lesson11(); myLesson.RefSample(ref test); Console.WriteLine(test); string first, middle, last; myLesson.OutSample("John Riley Doe", out first, out middle, out last); Console.WriteLine(first); Console.WriteLine(middle); Console.WriteLine(last); }
static void ModifierExamples() { int test = 14; Lesson11 myLesson = new Lesson11(); myLesson.RefSample(ref test); Console.WriteLine(test); string first, second; myLesson.OutSample("John Doe Mania", out first, out second); Console.Write(first); Console.Write(second); }