Java language overview, java Overview

Source: Internet
Author: User

Java language overview, java Overview

1. Software: System Software VS Application Software

2. Interaction between people and computers: use computer languages.
Graphical interface vs command line: dir md rd cd .. cd/del exit
 
3. Classification of languages: First Generation: Mechanical language; Second Generation: assembly language; Third Generation: advanced language (process-oriented)

4. Features of the java language: ① object-oriented ② robustness ③ cross-platform (write once, run anywhere) --- JVM java Virtual Machine

5. Install JDK and configure Environment Variables
① Install JDK
② Configure the environment variable (path that the Window operating system needs to search for when executing the command)
We need to save the path of the bin directory in jdk to the path environment variable.
③ Test: In the command line window, javac.exe‑java.exe can be successfully called under any directory.
 
6. How to compile and run a java program
[Process] compile --- run
① Writing: Every java file ends with. java and is called the source code. The java program exists in the source file.
Public class HelloWorld {
// The main method of the program, which is the entry of the program
Public static void main (String [] args ){
// Code to be executed
System. out. println ("HelloWorld ");
}
}
② Compile: In the source file directory, execute javac.exe source file name. Java; generate one or more bytecode files ending with one. class
③ Run: java.exe(the code file generated by the interpreter can be interpreted and executed by java.exe.

Note: The Java source file uses "java" as the extension. The basic component of the source file is a class, such as the HelloWorld class in this class.
A single source file can have only one public class. The number of other classes is unlimited. If the source file contains a public class, the file name must be named according to the class name.
The main () method is used to execute Java applications.
It has a fixed writing format: public static void main (String [] args ){...}
The Java language is case sensitive.
. A Java method is composed of several statements. Each statement ends with a comma. The braces appear in pairs and are indispensable.
 
7. debugging program Problems

8. Note: ① Single line comment // ② multi-line comment /**/
③ Document comment/***/javadoc-d file directory name-auhor-version source file name. java

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.