最终,是一个类?

时间:2016-01-28 12:13:09

标签: java

如果我写下面的枚举,

public enum States{
}

IDE正在目标中生成.class文件States.class,就像我写了一个名为 - States

的类一样

所以在这里,.class文件是否只是告诉我enum类型的Java字节代码是否存在,或者它是否意味着枚举最终是一种Java Class类型?

2 个答案:

答案 0 :(得分:0)

是枚举是Java类的类型。

curl -d '{"username":"abc@rediff.com","grant_type":"password","password":"XXXX"}' -H 'Content-Type: application/json' https://domain.hipchat.com/v2/oauth/token { "error": { "code": 401, "message": "Authenticated requests only. See https://www.hipchat.com/docs/apiv2/auth for more information.", "type": "Unauthorized" 是此类唯一可能的实例

答案 1 :(得分:-1)

当然可以。检查official documentation

with table_1 as (select 'aaa' pk_1, 'bbb' pk_2, 'ccc' pk_3, 'ddd' pk_4, 9 pk_5, 1 col_1, 2 col_2, 3 col_3 from dual union all
                 select 'aaa' pk_1, 'bbb' pk_2, 'ccc' pk_3, 'ddd' pk_4, 10 pk_5, 4 col_1, 5 col_2, 6 col_3 from dual union all
                 select 'aaa' pk_1, 'bbb' pk_2, 'ccc' pk_3, 'ddd' pk_4, 11 pk_5, 7 col_1, 8 col_2, 9 col_3 from dual),
                 -- end of mimicking your table table_1; you wouldn't need this subquery as you already have the table.
       dummy as (select level id
                 from   dual
                 connect by level <= 5),
          t1 as (select pk_1,
                        pk_2,
                        pk_3,
                        pk_4,
                        row_number() over (partition by pk_1, pk_2, pk_3, pk_4 order by pk_5) pk_5,
                        col_1,
                        col_2,
                        col_3
                 from   table_1)
select   pk_1,
         pk_2,
         pk_3,
         pk_4,
         listagg (nvl(col_1, 0)||nvl(col_2, 0)||nvl(col_3, 0), ' ') within group (order by pk_1, pk_2, pk_3, pk_4, pk_5) aggregate
from   dummy d
       left outer join t1 partition by (t1.pk_1, t1.pk_2, t1.pk_3, t1.pk_4) on (t1.pk_5 = d.id)
group by pk_1,
         pk_2,
         pk_3,
         pk_4;

PK_1 PK_2 PK_3 PK_4 AGGREGATE           
---- ---- ---- ---- --------------------
aaa  bbb  ccc  ddd  123 456 789 000 000 
  

这是所有Java语言枚举类型的通用基类。