• 基础:继承之Object类型的int 重点看CompareTo


       1:   static void ObjectFunctionality() {
       2:              int a = 12;
       3:              Console.WriteLine("=> System.Object Functionality:");
       4:              Console.WriteLine("12.GetHashCode()={0}",a.GetHashCode());
       5:              Console.WriteLine("12.Equals(23)={0}",a.Equals(23));
       6:              Console.WriteLine("12.GetType()={0}",a.GetType());
       7:              Console.WriteLine("12.GetTypeCode()={0}",a.GetTypeCode());
       8:              Console.WriteLine("12.ToString()={0}",a.ToString());
       9:              Console.WriteLine("12.CompareTo(11)={0}",a.CompareTo(11));
      10:              Console.WriteLine("12.CompareTo(23)={0}", a.CompareTo(23));
      11:              Console.WriteLine("12.CompareTo(12)={0}", a.CompareTo(12));
      12:          }

        结果:

              2009-12-13 14-54-07

    数值数据类型的成员:

       1:     static void DataTypeFunctionality() {
       2:              Console.WriteLine("Max of int:{0}",int.MaxValue);
       3:              Console.WriteLine("Min of int:{0}",int.MinValue);
       4:              Console.WriteLine("Max of double:{0}",double.MaxValue);
       5:              Console.WriteLine("Min of double:{0}",double.MinValue);
       6:              Console.WriteLine("double.PositiveInfinity,double的正无穷大:{0}",double.PositiveInfinity);
       7:              Console.WriteLine("double的负无穷:{0}",double.NegativeInfinity);
       8:              Console.WriteLine("大于零的最大double的值",double.Epsilon);
       9:   
      10:          }

    结果:

       2009-12-13 15-35-16

  • 相关阅读:
    结构化思考力
    对象序列化解析
    单元测试的规范
    关于CefSharp的坎坷之路
    构建基于Chromium的应用程序
    C# 面向切面编程(AOP)--监控日志记录方案
    CefSharp 中断点 已达到中断点
    用批处理命令实现激活office2016
    Winform开发中的困境及解决方案
    VUE+Element 前端应用开发框架功能介绍
  • 原文地址:https://www.cnblogs.com/UpThinking/p/1623014.html
Copyright © 2020-2023  润新知