class Program
{
public enum TimeOfDay
{
Morining,
Afternoon,
Evening
}
static void Main(string[] args)
{
Console.WriteLine(TimeOfDay.Afternoon); }
}

Console.WriteLine(TimeOfDay.Afternoon);//Afternoon

TimeOfDay TIME = TimeOfDay.Afternoon;

Console.WriteLine(TIME.ToString()); //Afternoon

Console.WriteLine(TIME); //Afternoon

C# Enum Type的更多相关文章

  1. Effective Java 03 Enforce the singleton property with a private constructor or an enum type

    Principle When implement the singleton pattern please decorate the INSTANCE field with "static ...

  2. C#中的枚举类型(enum type)

    ylbtech 原文 C#中的枚举类型(enum type) 概念 枚举类型(enum type)是具有一组命名常量的独特的值类型.在以下示例中: enum Color { Red, Green, B ...

  3. 【转】掌握java枚举类型(enum type)

    原文网址:http://iaiai.iteye.com/blog/1843553 1   背景 在java语言中还没有引入枚举类型之前,表示枚举类型的常用模式是声明一组具有int常量.之前我们通常利用 ...

  4. Effective Java Item3:Enforce the singleton property with a private constructor or an enum type

    Item3:Enforce the singleton property with a private constructor or an enum type 采用枚举类型(ENUM)实现单例模式. ...

  5. Java之创建对象>3.Enforce the singleton property with a private constructor or an enum type

     1. 通过一个公开的字段来获取单例 // Singleton with public final field public class Elvis { public static final Elv ...

  6. Hibernate map enum type

    1. Bean @Entity @Table(name = "entities") public class Entities { public enum entityType { ...

  7. ADO编程:error C2011: 'LockTypeEnum' : 'enum' type redefinition

     C++ Code  123   // Import the ADO type library #import "C:\\Program Files\\Common Files\\syste ...

  8. “locktype”enum type 类型重定义问题的解决

    作者:朱金灿 来源:http://blog.csdn.net/clever101 使用ado来连接数据库,结果出现这样一些编译错误: 1>f:\c++pro\iocptser\debug\msa ...

  9. 【转载】#458 Errors While Converting Between enum and Underlying Type

    You can convert to an enum value from its underlying type by casting the underlying type (e.g. int) ...

随机推荐

  1. 一个比较轻巧好用的js分页插件,可ajax可url

    var pageNav = pageNav || {}; pageNav.fn = null; pageNav.pre = "pre"; pageNav.next = " ...

  2. FastDFS分布式文件系统安装与使用(单节点)

    http://blog.csdn.net/xyang81/article/details/52837974 http://download.csdn.net/detail/xyang81/966749 ...

  3. ActiveMQ持久化消息

    ActiveMQ的另一个问题就是只要是软件就有可能挂掉,挂掉不可怕,怕的是挂掉之后把信息给丢了,所以本节分析一下几种持久化方式: 一.持久化为文件 ActiveMQ默认就支持这种方式,只要在发消息时设 ...

  4. Hubilder用git插件安装使用

    打开Hbuilder,工具->插件安装(git分布式版本管理插件) 打开https://www.github.com,注册.登录.创建仓库 在Hbuilder中新建项目→然后右键→Team→共享 ...

  5. 关于action script与js相互调用的Security Error问题

    大家都知道,as和js相互调用可以通过ExternalInterface.call和ExternalInterface.addCallback来进行. 比较好的做法是使用之前通过ExternalInt ...

  6. qt QString 与 int,char的转换

    每次QString转换int或者char的时候都要查资料,记录一下,方便下次查看. 参考: http://blog.csdn.net/ei__nino/article/details/7297791 ...

  7. 与Perl兼容的正则表达式函数

    <?php $str = "abc_ABC_123abc"; $patt = '/^abc(.*?)abc$/'; //有一个模式单元就会多一个存储 $arr = null; ...

  8. Spring中的@response和@request注解

    @response 标注对象返回的格式为json文本 @requestBody将json对象转换为对应的java类

  9. 由单例模式学到:Lazy<T>

    http://www.cnblogs.com/zhangpengshou/archive/2012/12/10/2811765.html http://www.cnblogs.com/anytao/a ...

  10. Linux下获取公网IP地址

    curl http://members.3322.org/dyndns/getipcurl http://ip.6655.com/ip.aspx