• C#函数


    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace ConsoleApplication1
    {
        class Program
        {
            在class Program中定义
                      有参数无返回值函数名前加void
            无参数有返回值在函数名前加返回值的类型
            //访问修饰符 函数名(参数1,参数2)
            //{
                //函数体
                //return 返回值
            //}
            /// <summary>       
            /// 无参数,无返回值
            /// </summary>
          1  public static void abc()
            {
                Console.WriteLine("无参数,无返回值");
            }
    
            /// <summary>
            /// 无参数,有返回值
            /// </summary>
           2 /// <param name="args"></param>
                public static int abc2()
            {
                return 1;
            }
    
            /// <summary>
            /// 有参数,无返回值
            /// </summary>
            /// <param name="args"></param>
           3 public static void abc3(int a,int b)
            {
                Console.WriteLine(a + b);
            }
            /// <summary>
            /// 有参数,有返回值
            /// </summary>
            /// <param name="args"></param>
           4 public static int abc4(int x,int y)
            {
                return x * y;
            }
            struct stu
            {
                public int id;
                public string name;
                public DateTime birthday;
                public double mark;
                public int age;
            }
            static void Main(string[] args)
            {
                //abc();
    
                //Console.WriteLine(abc2());
    
                //abc3(1, 2);
    
                //Console.WriteLine(abc4(2, 3));
                
    
                Console.ReadLine();
            }
        }
    }
  • 相关阅读:
    Netty实现Http客户端
    Netty实现Http服务端
    Netty实现Tcp客户端
    Netty实现Tcp服务端
    MySQL进阶系列:一文详解explain
    spring boot 获取运行时的yml里的active配置
    eureka 注册中心添加认证
    zuul 负载
    jenkins spring cloud
    秒杀系统如何设计?
  • 原文地址:https://www.cnblogs.com/skyhorseyk/p/7001937.html
Copyright © 2020-2023  润新知