Java Foundation: Java file name and class name relationship CLASSPATH

Source: Internet
Author: User

Java class modifier: The public adornment is typically used, at which point Java enforces the requirement. The Java file name must match the public-decorated class name, otherwise it cannot be compiled. If there is no modifier, the file name is not associated with the class name.

The. Java file recommends declaring only a single class and not creating multiple classes in the same class file.

When path is added, the rotation is added at the top of the current path, preventing the intermediate directory impact.

CLASSPATH When you run the program for the Java command, look for the. Class path, when you add CLASSPATH. Represents the current directory.

When you add project using idea, you configure the project SDK version, and the project compiles the file directory (when creating project, it is recommended to create an empty project, otherwise a module with the same name will be added automatically.) New Empty project, add module, current module does not show out folder)

Java Foundation: Java file name and class name relationship CLASSPATH

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.