Is there anything else other than class, interface or Enum?
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
精彩评论