Except classes and interfaces is there anything else we can write in a java source file? because what ever .java file i have seen will have either class or interface in it.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Aside from classes, interfaces, and enums, one can write a
package-info.javawhich contains the Javadoc comments and annotations for a package.There is some information regarding
package-info.javain Section 7.4.1.1: Package Annotations in The Java Language Specification, Third Edition.The use of
package-info.javafor package documentation is supported from the Javadoc tool which was shipped in Java 5. The What’s New in Javadoc 5.0 page has an entry on the support for package javadocs.Edit: Added information regarding support for annotations per Tom Hawtin – tackline‘s comment.