Two methods are defined in the Custom class, called each other, And called
1 using System; 2 using System. collections. generic; 3 using System. linq; 4 using System. text; 5 6 namespace Test06 7 {8 // class Class1 9 // {10 // public string Country () 11 // {12 // string strCountry = "Example of the method! "; 13 // return strCountry; 14 //} 15 // public string stradd () 16 // {17 // Program myProgram = new Program (); 18 // string strField = myProgram. cc () + this. country (); 19 // return strField; 20 //} 21 //} 22 // class Program23 // {24 // public string Cc () 25 // {26 // string strCc = "this is a"; 27 // return strCc; 28 //} 29 // static void Main (string [] args) 30 // {31 // Class1 class1 = new Class1 (); 32 // Console. WriteLine (class1.stradd (); 33 //} 34 //} 35 class Class1 // Two Methods 36 {37 public string exam () 38 {39 string strexam = "Example of the method! "; 40 return strexam; 41} 42 public string add () 43 {44 Program program = new Program (); // instantiate 45 string stradd = program. xp () + this. exam (); 46 return stradd; 47} 48} 49 class Program 50 {51 public string xp () 52 {53 string kt = "this is a"; 54 return kt; 55 56} 57 58 static void Main (string [] args) // (string [] args) sequence. uppercase for Main !!! 59 {60 Class1 class1 = new Class1 (); // instantiate
61 Console.WriteLine(class1.add());
62 }
63 }
64
65 }