First, knowledge of Java

Source: Internet
Author: User

1. The history of computer language
First generation language: Machine language 01 string composition, the machine can be directly identified, the development is difficult but the implementation of high efficiency.
Second-generation languages: assembly language introduced a number of instructions, relative to the machine language is easier to write, the dependence on the hardware is high, poor portability.
Third-generation languages: high-level languages are closer to human natural languages and easier to write.
Process-oriented language: C language
Object-oriented language: Java language, C # language


The history of 2.Java SUN--->oracle
The father of Java: James Gaussian Forest
1995 Java1.0 Beta
..
Java9

Features of the 3.Java
A. Cross-platform: JVM
B. Security
C. Simple
D. Fully object-oriented
E. Robust

Why 4.Java can cross-platform:
Depending on the JVM, the Java program is compiled into a platform-independent bytecode file that is then interpreted by the interpreter on the JVM.

5.JVM,JRE,JDK relationship?
Jvm:java virtual Machines
Jre:java the runtime environment, which contains the JVM and Java class libraries.
The Jdk:java Development Kit contains the JRE and tools for compiling, executing, or tracing.

6. How to configure environment variables for Java
A. Configuring Java_home
B. Configuration classpath,jdk5.0 above can be omitted.
C. Configure path

7. Development steps for writing the first Java program
A. Writing the Java source program (suffix. java)
public class class Name {
public static void Main (string[] args) {
System.out.println ();//line-Break output
System.out.print ();//non-newline output
}
}

Note: A source file can contain more than one class, but can only contain a public class that is decorated with public, and the file name should match the common class name.

eg
public class hello{
public static void Main (string[] args) {
System.out.println ("hello,zhangsan!");
}
}

Class hello2{
public static void Main (string[] args) {
System.out.println ("hello,zzsxt!");
}
}

B. Compiling a Java source file into a bytecode file (suffix. Class)
Javac source File
Eg:javac Hello.java

C. Run a bytecode file
Java class name
Eg:java Hello

8. Escape character
\ t: Tab stop, equivalent to a number of spaces
\ n: Line break

9. Comments (pseudo-code)---> Programmers
Comments are not interpreted, there are three of comments in Java
Single-line Comment://comment Content
Multiline Comment:/* Comment content */
Document Comments:/** comments */

10. Anti-compilation tool: Jd-gui.exe

My first program:

First, knowledge of Java

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.