JAVA Getting Started Learning (overview)

Source: Internet
Author: User

1.JAVA Virtual Machine

2. Garbage collection

3. Code Security

The Java language is interpreted to execute in a sense that the Java file is compiled (from the source file to the class file process)

The Java target code becomes the bytecode stored in the. class file is a binary code that does not depend on the hardware platform of the machine

Installation of the 1.JAVA development environment

2.JAVA Application (first program to print Hello world on screen)

Run a Java program by typing the following command on the command line

$ Java Program name "parameter list"

If more than one parameter is separated by a space

public static void Main (String args[])

Description of the keyword

Public indicates that main () is a publicly-owned method

The static compiler main () method is statically

String args[] Arguments to hold the command line

3. Compilation and operation of the program

Need to use two tools

1. Compiler Javac

2. Interpreter Java

Error 1:

Now write the first program according to the book (Hello World)

found that follow the steps to find the compilation is not a problem, run the time will appear java.lang.ClassNotFoundException: such errors

Online help Baidu found the need to re-environment variables in the Class_path added./Current path to solve, took a little time

Error 2:

Hierarchy error A. Java source file can contain three top-level elements, these three elements are:

    1. A package description, package statement, packet description optional
    2. Any number of incoming statements, that is, the import statement
    3. Class and interface descriptions

These statements appear in a certain order before a statement is introduced, before a statement is introduced before the class and interface

As a whole, the structure of the Java program is as follows:

    • Package Statement 0 or one must be placed at the beginning of the file
    • Import Statement 0 or more must be placed before all class definitions
    • public class definition: 0 or 1
    • Class Definition: 0 or more
    • Definition of interface: 0 or more
    • Each source file, at least one class, can have at most one public class, when the source file name, if the file contains the public class, the source file must be consistent with the class name

The above content comes from <java programming Fourth Edition > Sin Lia Yimei

JAVA Getting Started Learning (overview)

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.