zoukankan      html  css  js  c++  java
  • 学会了调用方法

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

    方法必须有一个返回值(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;

                }
            }

          
                  
        }
     
    }

  • 相关阅读:
    分数序列规律求和
    猴子吃桃算法
    猴子吃桃算法
    完数
    完数
    数字个数依次叠加 s=a+aa+aaa+aaaa+aa...a
    数字个数依次叠加 s=a+aa+aaa+aaaa+aa...a
    hbase(二)Java操作 hbase
    hbase scan startrow endrow 是否包括
    ListOrderedMap和Map
  • 原文地址:https://www.cnblogs.com/bluewelkin/p/1285114.html
Copyright © 2011-2022 走看看