首页 > 其他分享 >EnumInfo

EnumInfo

时间:2024-09-14 14:57:21浏览次数:3  
标签:Week Shrimpking Author create EnumInfo IDEA public


package com.shrimpking.t5;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Shrimpking
 * @create 2024/9/12 16:09
 */
public enum Week
{
    Sunday,Monday,Tuesday,Wednesday,
    Thursday,Friday,Saturday;
}
package com.shrimpking.t5;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Shrimpking
 * @create 2024/9/12 16:10
 */
public class EnumInfo
{
    public static void main(String[] args)
    {
        Class<Week> clz = Week.class;

        Week[] weeks = clz.getEnumConstants();
        for (Week w :weeks){
            System.out.print(w + "\t");
        }
    }
}

标签:Week,Shrimpking,Author,create,EnumInfo,IDEA,public
From: https://blog.51cto.com/u_15356972/12016810

相关文章