Java Beginner, Basic knowledge

Source: Internet
Author: User
Tags java se

Recently began to learn Java, the learning process to find some of the information and notes, ashamed to say, as a programmer, in the past two years, blog Park blog has not seen any growth, has so far taken note of these attention.

1. What is the difference between Java SE, Java EE and java ME ?

The development of Java is now not simply a language, but more broadly,Java represents a technology system. In this system,Java SE,java EE, andJava ME each represent different orientations.

Java SE is all called:java standard Edition (J2SE, java SE) standards Edition

The Java SE version provides the most basic environment for Java programs and is the core and foundation of Java technology. Java EE and Java ME are built on the basis of Java SE.

Key Learning: Collection classes, file operations,I/O flow, threading, serialization, and GUI form programming

Java EE is all called:java Enterprise Edition (EE is java EE) Business Edition

Java eejava The most widely used part. > not only java se Many of the advantages, while also providing ejb, , servlet xml

Key Learning:JSP,servelet,JDBC,EJB, and Struts,Spring,Hibernate and other lightweight frameworks

Java me is all called:java Micro editon (j2me java Me) miniature version

Java ME provides development and operational environment for embedded applications

Key Learning: Configurationand summary (Profile), etc.

2. What is the operating mechanism of the JAVA language?

Computer high-level programming languages are divided into: compiled and interpreted languages according to the way the program executes

Compiled language: A specialized compiler that compiles source code to a computer-recognized language (C,C + +) for a specific operating system at once

Explanatory language: Use a dedicated interpreter to interpret the source code as a machine instruction of a specific platform, explaining an execution sentence (PHP,ASP, etc.)

Java bytecode is platform agnostic, so it can be cross-platform, but Java virtual machine needs corresponding platform

The Java language does not belong to the above classification,Java is a compiled and interpreted type of complex

First, Java compiles the source program into a platform-independent bytecode file (class file) with a common compiler

The Java virtual machine (JVM) theninterprets the bytecode file for execution

The specific execution process for Java code:

3 . What is a JVM? What's the effect? Working mechanism?

Defined:

The JVM(Javavirtual machine) means the Java vm. Various computer functions can be simulated on the actual computer. have their own perfect hardware architecture, such as processors, stacks and registers, etc. also have the corresponding instruction system.

Role:

the loading of classes in the JVM is implemented by the class loader (ClassLoader) and its subclasses , which are responsible for finding and loading class file classes at run time.

1. The JVM is the Java bytecode execution engine that provides the necessary support for Java program execution.

2 . Optimize Java bytecode to translate it into more efficient machine instructions.

3. TheJVM masks information related to the specific operating system,and theJava program generates a bytecode file that can run on the JVM ( class files), The JVM is responsible for sending each byte code to be executed to the interpreter, which then translates the corresponding bytecode into the machine instruction of the corresponding platform and executes it, thereby implementing the cross-platform. (different platforms, different JVMs)

Working principle:

The JVM is at the bottom of the entire JDK and is responsible for interacting with the operating system to shield the operating system environment and provide a complete operating system environment.

The JVM in the operating system is implemented through the java.exe in the JDK , mainly through the following steps:

(1) Creating a JVM load environment and configuration

(2) Loading jvm.dll

(3) Initialize Jvm.dll

(4) Calling the jnienv instance to load and process class classes

(5) Running Java Programs

4. What is JRE(j2re)?

Introduction: jre Yes java runtime enviroment java runtime environment, yes java java virtual machines, Span style= "Font-family:times New Roman;" >java platform Core class and several supporting files.

Sun 's JRE products include:java Runtime enviroment and Java plug-in java runtim enviroment two parts are the Java platforms that can run, test, and transfer applications .

If you need to run in a browserJava Appletprograms thatJRErequires assistive software:Java Plug-in. The software can makeJava Appletand theJavaBeanscomponent in useSunCompany'sJREenvironment to run in a browser environment. The software can be used inNavigatorand theIEin whichMicrosoft comes with a virtual machine pairJavaenvironment support is not complete, it is best to install aSunCompany'sJREorJDK。

version management of the JRE:

Installing several different versions of the JRE on the same computer does not affect the running of the program, because the console uses the java.exe tool to execute the Java program. The operating system looks for the JRE environment in the following order :

(1) First find out if there is a JRE in the current directory

(2) Find out if there is a JRE in the parent directory

(3) Then find the JRE in the path specified by the environment variable path

(4) Registry Hkey_local_machine\software\javasoft\java Runtime enviroment\ view currentversion which key value to point to JRE

The most common is to find the JRE environment in PATH, and in general, each Java Software is temporarily set up in a batch file before it runs PATH value, and then put yourself in the use of the JRE The path is placed in PATH The path is the most front-end , so it will definitely use its own JRE, which will not cause version confusion

the base Class library for the JRE:

The base Class library that comes with the JRE is primarily in the Jre\lib\rt.jar file, which includes all class libraries running in the JAVA 2 platform, and the JRE version is consistent.

When the program runs, ClassLoader finds and loads the base class library and other class libraries that the program references .

Base Class Library: ClassLoader is automatically loaded into rt.jar (OS locates JRE through PATH environment variable ) , and then determine the location of the base Class library)

Other class libraries: ClassLoader The path search specified in the environment variable CLASSPATH , search on first-come, first-in, CLASSPATH The previous class library is first searched

So, before the JAVA program starts, set the environment variables for PATH and CLASSPATH

Java Beginner, Basic knowledge

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.