Java Learning 01

Source: Internet
Author: User

Java Learning 01 Chapter 1, JRE and JDK

The JDK (Java Develop Kit,java SDK) provides the Java development environment and the operating environment, mainly for the development of Java programs, for Java program developers; Java Development Toolkit

JDK = JRE + tools (compiler, debugger, other tools ...) ) + Class Library

The JRE (Java Runtime Environment,java Runtime Environment) provides the Java runtime environment, primarily for executing Java programs and for users of Java programs. Java Run-time environment

JRE = JVM (Java virtual machine) Java VM + Interpreter

The Lib under Lib:jre is just the jar package that runs the Java program and is used for the JVM runtime. Includes all the standard class libraries, and extension classes.

2. Operating mechanism of Java language

? 1. Computer language

? 2. High-level computer language

? (1) Compiled language (c, C + +)

SOURCE file----compiler----run executable file---machine instructions

? (2) interpreted language (JavaScript, Perl)

Text File---interpreter, direct translation into machine instructions

? (3) Compile first, then explain (Java)

. Java source files----------Class bytecode file (bytecode) JVM does interpretation

Line-to-real machine instructions

Write Once, run anywhere (once written everywhere)

2. Structure of Java Program

3. The first Java program

1. Editing the program Helloworld.java file

public class helloworld{

public static void Main (string[] args) {

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

}

}

2. Go to the file directory

CD F:

CD List

3. Compiling, running

Javac Helloworld.java generate bytecode. class

Java HelloWorld

4. Write run under Eclipse

(1) The file name is not the same as the class name

Javac + file name

Java + class Name

(2) A file has more than one class name the file name is the same as one of the class names

Javac file name

Java Individual class names

4. Environment variables

Path: Use Javac. Java commands or other JDK commands on any path

Classpath: Classpath tells JDK where the class file is located

Other tools for writing Java: notepad++ advanced Notepad

EditPlus jcreator eclipce MyEclipse Jbuilde

5. Javadoc Native HTML file 6, System API Help documentation

Help us find the use of functions to facilitate our programming

7. Garbage collection

System.GC () garbage collection

Runtime.getruntime (). GC (); garbage collection

8. Note:

1. If a class is a public class, the. java file name is identical to the public class name

2. A. java file should have only one public class

Java Learning 01

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.