当前位置: 首页 > news >正文

世界做火的游戏视频网站营销网站设计

世界做火的游戏视频网站,营销网站设计,php动态页面,怎样建网站 需要字面解释 explicit:清楚明白的;易于理解的;(说话)清晰的,明确的;直言的;坦率的;直截了当的;不隐晦的;不含糊的。 implicit:含蓄的;不直接言明的;成为一部分的;内含的;完全的;无疑问的。 operator:操作人员;技工;电话员;接线员;…

字面解释

explicit:清楚明白的;易于理解的;(说话)清晰的,明确的;直言的;坦率的;直截了当的;不隐晦的;不含糊的。

implicit:含蓄的;不直接言明的;成为一部分的;内含的;完全的;无疑问的。

operator:操作人员;技工;电话员;接线员;(某企业的)经营者,专业公司。

专业解释

explicit用于强制转换,implicit用于隐式转换

用法

public static 返回的结果类型 operator unary-operator (参数类型 param)
unary-operator:+ - ! ~ ++ — true false
public static 返回的结果类型 operator binary-operator (参数类型 param1, 参数类型 param)
binary-operator:+ - * / % & | ^ << >> == != > < >= <=
public static implicit operator 返回的结果类型 (参数类型 param )
public static explicit operator 返回的结果类型 (参数类型 param )

explicit、implicit都是与operator一起操作使用的,operator 关键字用于在类或结构声明中声明运算符。

示例

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConversionOperator
{public class IntDouble{private readonly int intV;private readonly double doubleV;public IntDouble(int value) : this(value, 0){}public IntDouble(double value) : this(0, value){}public IntDouble(int intV, double doubleV){this.intV = intV;this.doubleV = doubleV;}//将IntDouble类型隐式转为int类型,返回int类型public static implicit operator int(IntDouble intdouble){return intdouble.intV;}//将IntDouble类型显式转为double类型,返回double类型public static explicit operator double(IntDouble intdouble){return intdouble.doubleV;}//将int类型隐式转化为IntDoublepublic static implicit operator IntDouble(int intdouble){return new IntDouble(intdouble);}//将double类型显式转化为IntDoublepublic static explicit operator IntDouble(double intdouble){return new IntDouble(intdouble);}public static IntDouble operator ++(IntDouble intdouble){var t = intdouble.intV + 1;var t2 = intdouble.doubleV + 1;var temp = new IntDouble(t, t2);return temp;}public override string ToString(){return $"intV:{intV},doubleV:{doubleV}";}}internal class Program{static void Main(string[] args){IntDouble doubleV = (IntDouble)2.1;Console.WriteLine($"原始数据:{doubleV}");doubleV++;//此处IntDouble显示转为double类型double c = (double)doubleV;//此处IntDouble隐示转为int类型int c2 = doubleV;Console.WriteLine($"int的值:{c2},double的值:{c}");Console.WriteLine($"{doubleV}");Console.ReadKey();}}
}

结果

http://www.sczhlp.com/news/141570/

相关文章:

  • 南昌专业制作网站自己建网页
  • 江西那家做网站公司好山西建设机械网站首页
  • Tita 项目经营一体化建筑业企业解决方案
  • CD78.【C++ Dev】以AVL任务的bug讲讲调试技巧
  • 坡头网站建设公司做一名网络写手去那个网站好
  • 建行企业网站.网站建设风险
  • 靖宇东兴自助建站房产中介网站模板
  • 承德兴隆建设局网站怎么在百度打广告
  • wordpress图片上传插件长沙seo免费诊断
  • 旅游网站建设费用网页qq登录保护开启不了
  • 实用指南:AI 时代的安全防线:国产大模型的数据风险与治理路径
  • 写给自己的年终复盘以及未来计划
  • 最近难得的一点思考
  • 南京有制作网站的吗制作响应式网站报价
  • 手工制作方法专业网站优化
  • 最简单的做网站工具网站首页设计制作费用
  • 做网站的一些话术彩票网站是静态动态
  • 肇庆网站制作系统中山建公司网站
  • 建设网站需要网站开发中 倒计时 源码
  • 做五金外贸哪个网站比较好网站如何做中英文双语言
  • 公司备案查询网站深圳百度seo怎么做
  • asp+sql server典型网站建设案例 光盘北京网站建设大概多少钱
  • np.random.rand
  • Nexpose 8.22.0 for Linux Windows - 漏洞扫描
  • 冯延巳-风乍起,吹皱一池春水。
  • 大唐名相张九龄-海上生明月,天涯共此时
  • 郑州专业网站制作费用报价建设厅网站文件
  • 360网站建设搜索常州网站推广软件厂家
  • 购物网站 开店优惠券直播网站怎么做的
  • 前几年做那些网站致富世界网站制作