1. 程式人生 > >C#面向物件程式設計練習

C#面向物件程式設計練習

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        public class apple
        {
            public string info;
            public apple()
            {
            }   
            public string app(string[] a)
            {
                foreach (string value in a)
                    info += value + "+";
                info=info.Substring(0,info.Length-1);
                return info;
            }
        }
        static void Main(string[] args)
        {
            string[]b = new string[]{"Hello","GeoStrom","Haha"};
            apple A = new apple();
            Console.WriteLine(A.app(b));
            Console.WriteLine();
        }
    }
}