• 学会了调用方法


    创造了一个类,对象化,然后调用

    方法必须有一个返回值(int,string)或Void

    如 public int firstMethod()

    using System;
    using System.Collections.Generic;
    using System.Text;

    namespace test5
    {
        class Example
        {
            static void Main()
            {
              
                dgx gg = new dgx();
                int c = gg.firstMethod();
                Console.WriteLine(c);
                Console.Read();
                 
                          

                  
            }
            class dgx
            {
                public int firstMethod()
                {
                    int myField = 42; // ok
                    return myField;

                }

                public int anotherMethod()
                {
                    int myField = 52; // ok
                    return myField;

                }
            }

          
                  
        }
     
    }

  • 相关阅读:
    从1到n中找到任意num个数的和为sum的所有组合
    算法导论5.12
    使用c++技术实现下载网页
    算法导论5.13
    感慨
    算法导论2.37
    [转载]Yahoo!的分布式数据平台PNUTS简介及感悟
    Bigtable 论文笔记
    GFS 论文笔记
    MapReduce论文笔记
  • 原文地址:https://www.cnblogs.com/bluewelkin/p/1285114.html
Copyright © 2020-2023  润新知