Java first acquaintance

1.1  Java Overview

As we all know , Java is a programming language, and programming languages ​​are used to write software. So what kind of software can you use to write Java ? Many software you are familiar with can be written in Java , such as: QQ , Xunlei, Taobao, Jingdong, etc. So what is Java good at? That is to say, what kind of software will we write as Java development engineers in the future ?

the answer is:

  1. Internet: e-commerce, P2P , etc.;
  2. Enterprise-level applications: ERP , CRM , BOS , OA , etc.

Everyone is familiar with Internet software, because everyone can get it in their daily lives. Enterprise-level applications are software tailored for large enterprises and used in work.

1.2  Overview of Java Development Environment

Before starting to learn Java programming, we first need to install the Java development environment ( JDK : Java Development Kit Java Development Kit).

You may ask: "Why do we install JDK ?" In fact, everything needs to have its most basic living environment, just like human beings also need the most basic living environment (heaven, earth, water, air ... ). The development of Java programs is no exception. It also requires the most basic "living environment", which is the Java Development Environment ( JDK ).

 

1.3  JDK download & installation & verification

 

To download and install the JDK , please operate in strict accordance with the requirements in " JDK Download and Installation Document 0.doc ". If you do not follow the requirements, it may cause unexpected problems. I won't go into details here!

 

 JDK download address: http://www.oracle.com/technetwork/java/javase/archive-139210.html

 

Let's talk about how to verify whether the JDK installation is successful. You don't need to understand why you're doing this, just follow these steps exactly:

 

  1. Press: WIN+R key on the keyboard, then the Run window will pop up;
  2. Enter: CMD in the run window , press the "OK" button, then a DOS window will pop up;
  3. Enter in the DOS window: JDK installation path \bin\java.exe .

 

1.4 JDK and JRE

 

During the installation process, you may have noticed the term JRE . Let's talk about the relationship and difference between JDK and JRE .

 

1. JDK : It is a Java development and runtime environment. Of course, JDK must be installed on the programmer's computer ;

 

2. JRE : Java Runtime Environment It is a Java runtime environment. If you do not need to develop and only need to run Java programs, then you can install JRE . For example, the program developed by the programmer is eventually sold to the user, and the user does not need to develop, but only needs to run the program, so the user can install the JRE on the computer .

 

3, JDK contains JRE .

 

1.5 Cross-platform features

 

1. Platform refers to the operating system ( Windows , Linux , Mac ).

 

2. Java programs can run on any operating system, write once and run everywhere

 

3. The realization of cross-platform needs to rely on the Java virtual machine JVM ( Java Virtual Machine)

1.6  Introduction to Java Programs

 

 

 

Before starting the case, we need to understand the process of writing a Java application.

From the above figure, we can understand that the program written is roughly as follows;

  1. Source file: write Java source file (we also call it source code file), its extension is .java ;
  2. Compile: Then compile the source file into a bytecode file through the compiler, and the bytecode file extension is .class ;
  3. Run: Finally use the interpreter to run the bytecode file.

 

Compiling and running operations need to use DOS commands, so after writing the source code file, we need to learn common DOS commands, and then learn to compile and run.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325112312&siteId=291194637