Learn Java 1th Day

Source: Internet
Author: User
Tags clear screen

Myself is just beginning to self-study Java read the video and book =-=, just beginning I first on the command window to a general understanding, the first is open, you can right-start key, and then select the command prompt, I prefer the second kind, is to use win+r, and then input cmd enter, I think we need to master a few orders. switch of the drive letter D: Enter

entry of the catalogueCD Desktop\japan\nidongdeFallback for directoryCD..cd\Clear ScreenCLSExitexit.

Next, download it directly on the Oracle website. Then use Notepad to start writing our first program. (Note that the suffix is saved with. java) (All Helloword. ), do not understand anything. Hit it.

Class HelloWorld {
public static void Main (string[] args) {
System.out.println ("HelloWorld");
}
}

I probably read about Java, at the time of creation must be in a class, so be sure to define a class, the header file is also looking for knocking, how to execute it, we first want to find the directory installed Java, Then find the path of Javac.exe or copy down, in the command box with cd+ path, enter the Javac folder, and then compile Helloword (note that the file name is best and the class name is the same, because the compile time with the class name), specific: Javac Helloword.java, after compiling, you can go to the Javac directory to find, there is a. class file, then there is no problem ... Then execute, Java Helloword, OK. I found Java to be strictly case-sensitive. It's embarrassing to be wrong. --

It's troublesome to lose the path every time. So I looked for it, and here we need the environment variable, and with the environment variable, we can execute Java directly in the Command box.

Right-click My Computer-Properties-advanced properties-environment variables add a semicolon to the path where the Javac is located.

Learn Java 1th Day

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.