Define two methods in a custom class, calling each other

Source: Internet
Author: User

1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.Linq;4 usingSystem.Text;5 6 namespaceTest067 {8     //class Class19     //{Ten     //Public String Country () One     //    { A     //string strcountry = "Example of a Method!"; -     //return strcountry; -     //    } the     //Public string Stradd () -     //    { -     //Program MyProgram = new program (); -     //string Strfield = myprogram.cc () + this. Country (); +     //return Strfield; -     //    } +     //} A     //Class Program at     //{ -     //Public string Cc () -     //    { -     //string STRCC = "This is a"; -     //return STRCC; -     //    } in     //static void Main (string[] args) -     //    { to     //Class1 class1 = new Class1 (); +     //Console.WriteLine (Class1.stradd ()); -     //    } the     //} *     classClass1//Two methods $     {Panax Notoginseng          Public stringExam () -         { the             stringstrexam="example of a Method! "; +             returnStrexam; A         } the          Public stringAdd () +         { -Program program =NewProgram (); Instantiation of $             stringStradd = PROGRAM.XP () + This. Exam (); $                 returnStradd; -         } -     } the     class Program -     {Wuyi          Public stringXP () the         { -             stringKT ="this is a"; Wu             returnkt; -   About         } $    -         Static voidMain (string[] args)//(string[] args) The order is not wrong. Main Capital!!!  -         { -Class1 Class1 =NewClass1 (); Instantiation of
61

62

63

64

+}

Define two methods in a custom class, calling each other

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.