zoukankan      html  css  js  c++  java
  • java 枚举的用法

    public enum  StatisticTableEnum {
    
    	DOC_BROWSE_STATISTIC("doc_browse_statistic"),
    	DOC_LIB_BROWSE_STATISTIC("doc_lib_browse_statistic"),
    	SEARCH_KEY_STATISTIC("search_key_statistic"),
    	SEARCH_STATISTIC("search_statistic"),
    	USER_COLLECT_STATISTIC("user_collect_statistic"),
    	USER_COMMENT_STATISTIC("user_comment_statistic"),
    	USER_NOTE_STATISTIC("user_note_statistic"),
    	USER_STATISTIC("user_statistic");
    	private String tableName;
    
    	StatisticTableEnum(String tableName) {
    		this.tableName = tableName;
    	}
    
    	public String getTableName() {
    		return tableName;
    	}
    }
    

      代码中直接调用时就已经进行了构造函数的初始化:

    StatisticTableEnum.DOC_LIB_BROWSE_STATISTIC.getTableName()

    http://www.runoob.com/java/method-enum1.html

    
    
  • 相关阅读:
    还得还得学啊
    感觉自己写的东西很死板啊
    好烦啊,不知道选哪个?
    222
    111
    愁人啊
    ssm+ajax实现登陆
    ssm框架搭建
    抽象类与接口
    代理设计模式
  • 原文地址:https://www.cnblogs.com/Andrew520/p/9235182.html
Copyright © 2011-2022 走看看