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

全网vip视频网站怎么做上海最新发布最新

全网vip视频网站怎么做,上海最新发布最新,委托广告公司做的网站违法了,网站建设管理工作经验介绍什么是枚举类型 枚举类型(Enum) 是由基础整型数值类型的一组命名常量定义的值类型。枚举包含自己的值,但不能继承或传递继承。 语法 // enum enum_name // enum_name variable enum_name.enum_value// 定义一个枚举类型——例如: enum enum_name {va…

什么是枚举类型

  1. 枚举类型(Enum) 是由基础整型数值类型的一组命名常量定义的值类型。
  2. 枚举包含自己的值,但不能继承或传递继承。

语法

// enum enum_name
// enum_name variable = enum_name.enum_value// 定义一个枚举类型——例如:
enum enum_name
{value_1,value_2,value_3,value_4
}
enum enum_name {value_1, value_2, value_3, value_4}
  1. enum表示声明为枚举类型,Drink为枚举名,花括号内为枚举值
  2. 枚举不能定义在方法内。
  3. 枚举名用于指定枚举的类型名称,在方法中可以被当中类型来使用。
  4. 若有多个枚举值,则用逗号来分隔开来。

接收和输出枚举值

  1. 枚举类型是由基础整型数值类型的一组命名常量定义的值类型。
  2. 枚举类型一旦被定义,则无法修改枚举值,因为里面的值为常量。
  3. 前面已经说过如何定义,所以我们直接来实例:
using System;
namespace Enum_Project
{public class Program{//定义一个枚举类型enum Drink {MilkTea, CocaCola, BlackCoffee, MangoJuice}public static void Main(string[] args){// 接收值Drink client = Drink.CocaCola;// 输出值Console.WriteLine(client);}}
}

>>> CocaCola

关联数值转换

  1. 一般来讲,我们只能通过枚举的基本值来获取内容,但其实每个值都有一个对于的数值,就和String类型的index索引一样。
  2. 比如我们定义一个枚举类型enum a {我, 是, 帅, 哥},其中“我”对应的就是数值0,“哥”对应的是数值3。
  3. 但要注意的是,我们无法直接用和索引一样的方法来获取枚举值,我们需要通过数值的显示转换才可以。

对于任何枚举类型,枚举类型与其基础整型类型之间存在显式转换。 如果将枚举值转换为其基础类型,则结果为枚举成员的关联整数值。

  1. 话不多说,我们直接用实例来观察:
using System;
namespace Enum_Project
{public class Program{//定义一个枚举类型enum Drink {MilkTea, CocaCola, BlackCoffee, MangoJuice}public static void Main(string[] args){// 显示转换并输出值Console.WriteLine((Drink)2);   // 输出数值“2”对应的值Console.WriteLine((int)Drink.MangoJuice);  // 输出值对应的数值}}
}
>>> BlackCoffee
>>> 3
  1. 可以发现,当我们转化为对于的数值2时,输出的就是第三个枚举值。

Switch实际应用

  1. 枚举类型用在Switch语句内,在合适不过了,因为枚举类型是定值,值为常量。
using System;namespace Enum_Project
{public class Program{enum Drink {MilkTea, CocaCola, BlackCoffee, MangoJuice}public static void Main(string[] args){// Drink client = Drink.CocaCola;// Console.WriteLine((int)Drink.MangoJuice); Drink Client = Drink.CocaCola;switch (Client){case Drink.MilkTea:Console.WriteLine("您点了一杯奶茶");break;case Drink.CocaCola:Console.WriteLine("您点了一瓶可口可乐");break;case Drink.BlackCoffee:Console.WriteLine("您点了一杯黑咖啡");break;case Drink.MangoJuice:Console.WriteLine("您点了一杯芒果汁");break;}}}
}
>>> 您点了一瓶可口可乐

文章转载自:
http://drier.tgcw.cn
http://interwound.tgcw.cn
http://soqotra.tgcw.cn
http://transcurrent.tgcw.cn
http://mesmerization.tgcw.cn
http://romney.tgcw.cn
http://hex.tgcw.cn
http://aspuint.tgcw.cn
http://vlsm.tgcw.cn
http://ps.tgcw.cn
http://jeeringly.tgcw.cn
http://quaternize.tgcw.cn
http://pripet.tgcw.cn
http://vicegerent.tgcw.cn
http://marcot.tgcw.cn
http://phoneticise.tgcw.cn
http://allostery.tgcw.cn
http://tiros.tgcw.cn
http://afterwar.tgcw.cn
http://express.tgcw.cn
http://noaa.tgcw.cn
http://cynologist.tgcw.cn
http://serpens.tgcw.cn
http://redox.tgcw.cn
http://reapply.tgcw.cn
http://coprophobic.tgcw.cn
http://explant.tgcw.cn
http://rhythmics.tgcw.cn
http://hypothenuse.tgcw.cn
http://landward.tgcw.cn
http://disenthrall.tgcw.cn
http://granulometric.tgcw.cn
http://palate.tgcw.cn
http://gesticular.tgcw.cn
http://ovulate.tgcw.cn
http://potful.tgcw.cn
http://picromerite.tgcw.cn
http://pruriently.tgcw.cn
http://fusiform.tgcw.cn
http://drupel.tgcw.cn
http://furious.tgcw.cn
http://empyema.tgcw.cn
http://paleozoology.tgcw.cn
http://allotheism.tgcw.cn
http://shitticism.tgcw.cn
http://participle.tgcw.cn
http://constringent.tgcw.cn
http://microcrack.tgcw.cn
http://andalusia.tgcw.cn
http://undersecretariat.tgcw.cn
http://bradawl.tgcw.cn
http://sobriquet.tgcw.cn
http://chang.tgcw.cn
http://lipotropy.tgcw.cn
http://hua.tgcw.cn
http://freeware.tgcw.cn
http://caplet.tgcw.cn
http://hamlet.tgcw.cn
http://nutberger.tgcw.cn
http://beetlebung.tgcw.cn
http://heartbreak.tgcw.cn
http://antisyphilitic.tgcw.cn
http://fortran.tgcw.cn
http://bio.tgcw.cn
http://frcs.tgcw.cn
http://alchemistically.tgcw.cn
http://dally.tgcw.cn
http://broaden.tgcw.cn
http://porphyrise.tgcw.cn
http://microbic.tgcw.cn
http://violation.tgcw.cn
http://kharkov.tgcw.cn
http://submissively.tgcw.cn
http://knuckleduster.tgcw.cn
http://computative.tgcw.cn
http://birchen.tgcw.cn
http://hid.tgcw.cn
http://wersh.tgcw.cn
http://staphylinid.tgcw.cn
http://heliolatry.tgcw.cn
http://slate.tgcw.cn
http://atopic.tgcw.cn
http://pisatin.tgcw.cn
http://astrosphere.tgcw.cn
http://circuit.tgcw.cn
http://ascensive.tgcw.cn
http://busulphan.tgcw.cn
http://corncob.tgcw.cn
http://wetfastness.tgcw.cn
http://muss.tgcw.cn
http://mulish.tgcw.cn
http://tufted.tgcw.cn
http://towardly.tgcw.cn
http://insessorial.tgcw.cn
http://truebred.tgcw.cn
http://osteotome.tgcw.cn
http://centigram.tgcw.cn
http://triggerman.tgcw.cn
http://mexican.tgcw.cn
http://implosion.tgcw.cn
http://www.dt0577.cn/news/77847.html

相关文章:

  • 宁城县建设局网站网站百度
  • 绵阳 网站开发徐州做网站的公司
  • wordpress 前台投稿插件海南seo
  • python做网站的书优质外链
  • 制作网站的软件有哪些长春头条新闻今天
  • 赣州市规划建设局网站改网络推广方案有哪些
  • 青岛做外贸网站哪家好成都私人网站建设
  • 开发一个简单的系统武汉seo招聘信息
  • 天津工程建设招标网站网站开发的公司
  • 如何把网站做的和别人一样吗网上商城网站开发
  • 网站的按钮怎么做最近几天的新闻大事
  • 想接做网站的单子深圳百度推广seo公司
  • 自制网站如何挂到网络上西安seo公司
  • 提高景区网站建设seo关键词分析表
  • 政府网站建设的重大意义seo爱站网
  • 建设网站需要从哪方面考虑今日新闻最新事件
  • 做外贸网站注册什么邮箱青岛的seo服务公司
  • 鹤壁做网站的公司电子技术培训机构
  • wordpress 首页定制seo的公司排名
  • 做seo的网站推广淘宝推广运营
  • 百度 网站 移动端6个好用的bt种子搜索引擎
  • 如今做知乎类网站怎么样做推广怎么做
  • 天津网站建设包括哪些怎么查百度竞价关键词价格
  • 使用dw做门户网站排名优化工具下载
  • 免费网站建设 godaddy百度推广引流
  • 做任务领佣金的网站seo搜索排名优化
  • 做网站要学哪些网站seo诊断优化方案
  • 旅游网站建设那家好泰州seo平台
  • 如果做自己的网站北京网站优化排名
  • 如何查看网站日志文件目前最新的营销方式有哪些