Black Horse Programmer--java Overview

Source: Internet
Author: User

First, Java language Overview and three major technical architectures

1 , Java Language Overview

Java is an Internet-facing programming language introduced by Sun Company in 1995. Its characteristics are: object-oriented, universal, high efficiency, security, cross-platform. As Java technology continues to mature in the web, it has become the preferred development language for Web applications.

2 , Java Three technical architectures

Java is made up of four aspects: Java programming language, Java file format, Java Virtual Machine (JVM), Java application interface (Java API)

Java has three technical architectures with the following content:

(1) EE (Java 2 Platform Enterprise Edition): Known as Java EE after the jdk5.0 version, is a set of solutions for applications in developing enterprise environments. The technologies included in the technology system, such as Servlet JSP, are mainly for Web application development.

(2) J2SE (Java 2 Platform standard Edition): Known as javase after the jdk5.0 version, is the main learning element in the Java Foundation phase, containing classes that form the core of the Java language. For example: database connection, interface definition, input/output, network programming and so on.

(3) J2ME (Java 2 Platform Micro Edition): After the jdk5.0 version is called Javame, this technology is more used in some electronic products embedded development.

Second, Java virtual machines, Java operating Environment, Java operating mechanism

1 , Java Virtual Machine (English name: javavirtual Machine . Abbreviation:JVM)

The Java Virtual machine is an abstract computer, which is realized by simulating various computer functions on the actual computer. Java Virtual machine has its own perfect hardware architecture, such as processor, stack, register, etc., also has the corresponding instruction system. The JVM masks information related to the operating system platform, making it possible for Java programs to run without modification on multiple platforms by simply generating bytecode that runs on the Java virtual machine. This also makes Java a powerful cross-platform capability.

Java virtual machines are non-cross-platform, different operating systems have different JVM versions, the common version of the JVM is: Windows version, Linux version, Mac version.

2 , Java Operating Environment Construction

(1) JRE (Java Runtime Environment): Java Runtime Environment, including "Java Virtual machine" and "core class library required by Java program". If you are simply running a Java program that has already been developed, you only need to install the JRE in your computer.

(2) JDK (Java Development Kit): Java SDK (set), mainly includes JRE and Java development tools. Java development tools include the compiler tool (Javac.exe) packaging Tool (Jar.exe), and so on.

3 , Java operating mechanism

Third, Java configuration steps for Environment variables

1 , first download JDK , and install.

2 , Configuration Java environment variables, configure the steps as follows:

    • Right-click "My Computer" > "Environment variable";
    • Create a new Java_home variable in the system variable with the variable value: C:\Program files\java\jdk1.6.0_14 (based on your JDK installation path);
    • Create a new classpath variable with a variable value of:.; %java_home%\lib;%java_home%\lib\tools.jar;
    • Add variable value in Path variable (existing without new):%java_home%\bin;%java_home%\jre\bin (Note the ";" between the variable values) separated);

3 , the test environment variable configuration is successful:

Click the "Start"->; on your computer Run, type "cmd", type the command command, the command Line window appears, in the Command Line window, enter Java-version, Java, Javac and other commands to see if there are Java-related prompts, if present, the environment variable configuration is successful.

Four, Java Notes

Java has three-format annotations: Single-line comments, multiline comments, document annotations

1. Single- line Comment:

Format://comment content,//After the end of the line all content will be ignored by the compiler.

2. Multi-line annotations

Format:/* All characters between the comment contents */,/* */are ignored by the compiler.

3. Documentation Comments

Format:/** comments */, all characters between/** * * are ignored by the compiler, Java Special (for generating documents). Usually written before a class, domain, constructor, method, definition. Note content can be resolved by the tool Javadoc.exe in the JDK, generating a set of documentation that is described in the form of a Web file.

Note: annotations usually have two functions: (1) Note Description of the program code, and (2) can be used to debug the program.

Five, Java The naming rules for identifiers in

(1) consists of letters, numbers, underscores, and $, and cannot begin with a number.

(2) Java is a strongly typed language and is strictly case-sensitive.

(3) The use of keywords and reserved words in Java is not allowed.

(4) Do not use the class name inside the Java API as your own.

Six, the habit of beginners to write code

Programming language is used to realize the process of human thought. Therefore, the novice programmer, can put their own programming ideas first, and then in the use of programming language to achieve. can use the form of comments to comb their own programming ideas, the format is as follows

/*

Requirement: Description of function realization;

Idea: 1 、...... 2 、......

Step: 1 、...... 2 、......

*/

The specific cases for getting started are as follows:

/*

Requirement: Practice a Hello World program.

Ideas:

1, the definition of a class, because Java programs are defined in the class, Java programs are in the form of a class, the form of a class is actually a byte-code file is finally embodied.

2. Define a main function. In order for the class to run independently.

3, because the demo Hello World, see the word on the console, so you need to use the output statement to complete.

Steps:

1, use class keyword to complete the definition of the class, and a strong reading of the class name.

2. Main function: public static void Main (string[] args) is now in fixed format. The JVM knows.

3, use the output statement: System.out.println ("Hello World").

*/

Class demo{

Define a main function, in order to ensure that the program runs independently.

public static void Main (string[] args) {

This is an output statement that prints the data in parentheses to the console, where ln can wrap at the end of the data.

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

}

}

Black Horse Programmer--java Overview

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.