Java Learning II: Javac Java Learning (original)

Source: Internet
Author: User

After installing the JDK, you can compile and execute a simple Java program,

One, Javac, Java

Relationship of path name and package name:

Under D, build the folder test, create the file Java1.java in test (the class name should be the same as the file name)

Java1.java:

Package Test;

public class JAVA1

{

public static void Main (string[] args)

{

System.out.println ("Hello World");

  }

}

Commands to use:

D:\Test\javac Java1.java---> Get java1.class

Because the Java1.java inside uses the package test, this time if does not change the path, must under the test new folder test,

Use command D:\Test\java JAVA1-No,

D:\Test\java TEST.JAVA1-I can't find the file

Use the command D:\Test\javac. Java1.java----Get the folder corresponding to the package

Use the command D:\Test\java TEST.JAVA1 or D:\Test\java test\java1 to get the correct results

After obtaining the corresponding folder, using D:\Test\Test\java Java1 is also incorrect,

Second, the general class and the main class difference.

Java Learning II: Javac Java Learning (original)

Related Article

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.