Java Great God recommended, basic Java Programming Essentials (Must SEE)

Source: Internet
Author: User
Tags save file

in theThere are no previous operating habits of the errorcases of, but it is easy to accept new knowledge, so don'tJavaignorance and inferiority, on the contrary, this is the advantage of beginners, but how to get from a rookie experience intoGreat god, of course, it is necessary to learn, do not learn to becomeGreat godis daydreaming, so if you want to change yourself, then you can come to ourCommunication Groupto learn521595826,here every day to learn new knowledge, it is difficult to make progress, but if you are a non-enterprising person, while cool to go. The following is a basic prerequisite for Java programming:

The first step: Download and install the JDK 6.0with the installation path : C:\java\jdk1.6.

Step Two:Right-click on My Computer, select Properties, select the Advanced tab in the System Properties window, and then press the Environment Variables button to bring up a window for environment variables, create a new variable in the system variable, and a variable named "Java_home", the value of the variable is"C:\java\jdk1.6"; if there is"PATH"Variable name,Press Edit to enter the value of the variable at the front"C:\java\jdk1.6\bin;". (note End with a semicolon,No quotes.If not"PATH",Click Create a new"PATH"Variable name,The same as the variable value).

Step Three: Click Start, run, enter CMD in the popup run window ,Press ENTER, open a command-line window , enter Javac, you will see a series of Javac common parameter Options . Congratulations to you . Java the installation of the environment was successful .

Fourth Step:Start programming(pay attention to the first double hit Open"My Computer", in"Tools" ,"Folder Options",Click"View"Options -in the"Advanced Settings"found in"Hide extensions for known file types"the front of the small hook removed). In theCCreate a new subdirectory in the root directory of the disk, named"Javatest",as a storageJavasource code of the place. In thejavatestfolder, create a new text document, put the new text document. txt"instead"Helloworld.java". Open with Notepad"Helloworld.java",input:

public class HelloWorld {

public static void Main (string[] args) {

System.out.println ("Hello, world!");

System.out.println (" Congratulations on successfully running your first java application !");

}

}

Note The source file name must be the same as the class name , and the class modifier is public and the filename suffix is ". Java". Save File .

Fifth Step: Enter CD C:\JavaTestin the Command Line windowto transfer the current path to the javatest directory. Then, enter javac Helloworld.java, andtheJDK will compile in the javatest folder to generate a the helloworld.class class file.

Sixth step: Enter java HelloWorldin the command-line window( Note that HelloWorld does not have a . class suffix ) the screen appears

Hello world!

Congratulations on successfully running your first Java application !

Successful, the first Java application was compiled and run successfully .

I don't knowWin7whether the Notepad upgrade, the general beginnerJavaprogramming, using Notepad to write programs is a good way to learn, butXPin Notepad lack of text highlighting, indentation, line number and other text editing functions. Recommended forEditPlusorUEEditor. Learn in additionJavaProgramming, UnderstandingJavaA few basic name terms are also necessary.: Javasource files,Javabyte-code file,JDK,JRE,JVM.

Javathe source file is". Java"file with the suffix name, save the one you wroteJavaprogram code. Javathe name of the source file must be the same as the source file Publicthe name of the class is the same. Each source file has a maximum of one Publicclass, if any, then the source file must have the same name. If the source file does not have Publicclass, the source file can be any name, but is typically the same as the class name, and a class in a file.For example: Helloworld.java, Myclass.javaand so on the show isJavasource File.


Java Great God recommended, basic Java Programming Essentials (Must SEE)

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.