a Java language overview
Java is an object-oriented programming language that can compose cross-platform applications. Java technology has excellent versatility, efficiency, platform
Portability and security, widely used in PCs, data centers, game consoles, science supercomputers, mobile phones and the internet, with the world's largest
Professional community of developers.
Java is made up of four aspects:
(1) The Java programming language, or syntax.
(2) Java file format, which is the suffix of various folders and files.
(3) The Java Virtual machine (JVM), the interpreter that processes the *.class file.
(4) Java Application Interface (Java API).
Two versions of the Java language platform
Javase (Java 2 Platform standard Edition) edition
is a solution for developing common desktop and business applications. The technology system is the basis for the other two, which can be done with some desktop applications
of development.
Javame (Java 2 Platform micro Edition) Mini version
It is a solution for the development of electronic consumer products and embedded devices.
Java EE (2 Platform Enterprise Edition) Corporate Edition
is a set of solutions for developing applications in an enterprise environment. The technologies included in the technology, such as Servlets, JSPs, etc., are mainly aimed at
Web application development.
Three Java language features
(1) Simplicity
The Java language is an object-oriented language that provides the most basic way to accomplish a specified task by simply understanding some of the basic concepts that can be used
It writes applications that are suitable for a variety of situations. Java omits fuzzy overviews such as operator overloading, multiple inheritance, and so on , and by implementing automatic garbage collection large
Greatly simplifies the memory management work of the program designer.
(2) Object-oriented
The design of the Java language focuses on objects and their interfaces, which provide a simple class mechanism and a dynamic interface model. Object that encapsulates its state variable to
and the corresponding method, which realizes modularization and information hiding, while the class provides a prototype of a class of objects, and inherits mechanism, subclasses can use the parent class to provide
method, which implements the reuse of code.
(3) Distributed processing
Java is a network-oriented language. The class library that it provides can handle the TCP/IP protocol, and users can easily access it via a URL address on the network
It objects.
(4) Structural neutrality
The Java interpreter generates architecture-independent bytecode directives, and as long as the Java Runtime system is installed, Java programs can be shipped on any processor
line. These bytecode directives correspond to the representations in the Java Virtual machine, and the Java interpreter gets the bytecode and transfers it to a different platform, enabling it to be shipped
Yes.
(5) Open source
Java is an open-source language, and we can see other people's Java code.
(6) Cross-platform
Platform-independent features allow Java programs to be easily ported to different machines on the network. At the same time, Java's class library also implements different platforms.
interface so that these class libraries can be ported. In addition, the Java compiler is implemented by the Java language, and the Java Runtime system is implemented by standard C, which makes the Java system itself
Portability is also available.
(7) Explanatory
the Java interpreter interprets the Java bytecode directly for execution. The bytecode itself carries many compile-time information, making the connection process simpler.
(8) High performance
Unlike other languages such as Basic and TCL, Java bytecode is designed so that it can be easily converted directly to a specific CPU machine.
The code, resulting in higher performance.
(9) Multithreading
Multithreading enables applications to execute in parallel, and the synchronization mechanism guarantees the correct operation of shared data. By using multi-threading, programmers can
to perform specific behaviors with different threads, instead of having to adopt a global event loop mechanism, implement real-time interactive lines on the network
For.
(10) Dynamic nature
Ava's design makes it suitable for an ever-evolving environment. New methods and instance variables can be freely added to the class library without affecting the user program's
execution. and Java supports multiple inheritance through interfaces, making it more flexible and malleable than strict class inheritance .
(11) Security
Java for network and distributed environments must be protected from virus intrusion. Java does not support pointers, and all access to memory must pass through an instance of the object
, which prevents programmers from accessing the private members of the object using deception such as Trojan, and avoids the error that is easily generated by the pointer operation.
Miss.
the cross-platform of the four Java languages
Applications written in the Java language can be run on different system platforms. As long as the operating system needs to run the Java application, first
Install a Java Virtual machine (JVM java VM). The JVM is responsible for the operation of the Java program in the system. Let's see a picture.
Solution:
Because of the JVM, the same Java program can be executed in three different operating systems. This realizes the cross-platform of the Java program.
Also known as Java has good portability. Note: The Java language is cross-platform, and the JVM is not cross-platform.
five roles and relationships of JDK, JRE, JVM
JRE (Java Runtime Environment Java Run environment): Includes Java Virtual machine (JVM java VM) and Java program required
Core class library, if you want to run a well-developed Java program, you only need to install the JRE on your computer. This is the Jre:jvm+ class library.
JDK (Java Development Kit Java SDK): JDK is available to Java developers, which includes Java developers
also includes the JRE. So with the JDK installed, you don't have to install the JRE separately. One of the development tools : Compilation tool (Javac.exe) Packaging tool
(Jar.exe) and so on. This is the development tool of Jdk:jre+java.
Why does the JDK include a JRE?
First , the development of the program, always need to run a look at the effect.
Second, and most importantly, the development tools in the JDK are actually written in the Java language application, in order to facilitate the use of packaging as EXE files, such as
If there is no JRE, these tools cannot be run.
the relationship between the three is simply: Java programs developed using the JDK are delivered to the JRE to run, and the JVM guarantees cross-platform.
Download and install the six JDK
Download
(1) Open Oracle website: http://www.oracle.com
(2) Click Downloads and select Java for Developers
(3) Select downloads and Java SE
(4) for different operating systems, download different JDK versions to identify the operating system of the computer
Installation
Remember the path that you installed during the installation process. My installation path is: E:\Java\develop\jdk1.8.0_25
Seven HelloWorld cases
(1) Open the Bin directory in E:\Java\develop\jdk1.8.0_25, we can see a lot of application files, of which there are two we need to make
use, just It's Javac.exe and Java.exe.
(2) First write the Java source Code program, extension. java. We create a new Notepad file in this folder, write the following code, and finally will remember
This file is saved as a file in Helloworld.java format. Because now only the current directory has Javac and Java, so now the Java source files are saved in the
The current directory.
public class helloworld{public static void Main (string[] args) System.out.println ("Hello World");} }
(3) Turn on DOS and use the CD command to enter the specified folder: E:\Java\develop\jdk1.8.0_25\bin
(4) in the command line mode, enter the Javac command to compile the source code, generate the bytecode file
Format is: Javac Helloworld.java
(5) After the completion of the compilation, if there is no error message, enter the Java command to interpret the class bytecode file to run, do not need to to add a. class extension
Name.
Format: Java HelloWorld
Finally, we use diagrams to explain how the Java program works and how it operates:
Javase Introductory Learning 2:java Development Preparation Basics