开发者

Is there anything else other than class, interface or Enum?

开发者 https://www.devze.com 2022-12-23 14:00 出处:网络
As we know to generate a class file there should be atleast one class or interface or an Enum should be declared in the java file.

As we know to generate a class file there should be atleast one class or interface or an Enum should be declared in the java file.

So i was curious that is there anything else as well other the men开发者_开发知识库tioned which can cause a class file generation.

Or did anybody think that as we can declare the above mentioned, we can declare this(Which you think) as well ?


There are annotations.

public @interface MyAnnotation
{
    String someValue();
}

And then there are other languages like Scala that compile things to class files.


I do not think there is any other way apart from enum, interface and class. I dont consider annotation as different ones

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号