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;

                }
            }

          
                  
        }
     
    }

  • 相关阅读:
    springcloud-04-自定义ribbon的配置方式
    springcloud-03-服务注册
    springcloud-02-eureka
    springcloud-01-介绍
    使用jdk生成ssl证书文件
    CentOS7忘记root密码的修改方法
    2.1 Scala语言概述
    1.大数据技术概述
    KL散度=交叉熵-熵
    7.数据结构---图(遍历)
  • 原文地址:https://www.cnblogs.com/bluewelkin/p/1285114.html
Copyright © 2011-2022 走看看