Java programming language concepts

#Java programming language concepts and main features, keywords and basic grammar

##One, Java programming language concept

1. Java is the general term for Java object-oriented programming language and Java platform launched by Sun Microsystems in May 1995. Co-developed by James Gosling and colleagues, and officially launched in 1995.
2.
Java is divided into three systems:
· JavaSE (J2SE) (Java2 Platform Standard Edition, Java Platform Standard Edition)
· JavaEE (J2EE) (Java 2 Platform Enterprise Edition, Java Platform Enterprise Edition)
· JavaME (J2ME) (Java 2 Platform Micro Edition, java platform micro edition).
Among them, "JavaME (J2ME)" is a development language for the micro mobile device platform.
3.Java is a collective term, and there are:
(1).JDK: English name Java Developer Kits (Java development tools).
(2). JRE: English name Java Runtime Environment (Java Runtime Environment).
(3). JVM: English name Java Virtual Machine (virtual machine).
(4). The relationship between these three is: a layered nesting relationship, JDK contains JRE, and JRE contains JVM;
(4) Development:
(1). In June 1999, Sun released three versions of Java: Standard Edition (J2SE), Enterprise Edition (J2EE) and Micro Edition (J2ME).
(2). At 18:00 PM on September 30, 2004, J2SE1.5 was released, becoming another milestone in the history of Java language development. To express the importance of this version, J2SE1.5 was renamed Java SE 5.0.
(3). On April 20, 2009, Oracle (Oracle) acquired Sun for USD 7.4 billion. Obtain the copyright of java.
(4). On September 26, 2018, JavaSE11 was released. This is the first long-term support version after the major Java version cycle changes (LTS version continues to support until September 2026), (LTS stands for long-term application support, no continuous update required). Java11 brings ZGC, HttpClient and other important features, including a total of 17 JEPs (JDK Enhancement Proposals, JDK enhancement proposals).
(5). Java SE8, this version upgrade brings a lot of new features such as brand-new Lambda expressions and streaming programming to Java.
5. Streaming programming: In the past, if a class was assumed, it would be called continuously when multiple methods were called, while streaming programming would continuously call multiple methods in the same call.

##The main features of the
Java language. Java language is cross-platform.
Java language is simple.
Java language is an interpreted language.
Java language is distributed.
Java language is robust.
Java language is multi-threaded.

1. Object-oriented: Object-oriented refers to the basic granularity of objects, which contains attributes and methods. The description of the object uses attributes to express how to operate the object. Object-oriented technology makes application development simple and easy to use, saving code.
Insert picture description here

2. Cross-platform: The so-called cross-platform means that software can run normally in any computer environment without being restricted by computer hardware and operating systems. In the Java language, the virtual machine that comes with Java is a good cross-platform. Java source code is compiled to generate binary bytecode, which is platform-independent, but a machine code instruction that can be recognized by the Java virtual machine. The Java virtual machine provides a barrier from bytecode to the underlying hardware platform and operating system, making the Java language cross-platform.
3. Java Virtual Machine (Java Virtual Machine) for short: JVM, which is also the core mechanism of Java.
Insert picture description here

4. Security:
(1) Language-level security: Java's data structure is a complete object, and these encapsulated data types have security. When compiling, check the Java language and semantics to ensure that each variable corresponds to a corresponding value.
(2) Security at compile time: Java classes are generated after compilation. The runtime Java classes need to be loaded by the class loader.
(3) Runtime security: It can be run after being compiled and verified by a bytecode verifier.
(4) Executable code security: When a Java class is used on the network, its permissions are set to ensure the security of the accessed user.
5. Multithreading: Two or more threads are allowed to exist in an application program at the same time, which is used to support transaction concurrency and multitasking, and some classes, methods, etc. are defined to establish and manage user-defined multithreading.
6. Simple and easy to use: The writing of source code is not restricted to a specific environment.

##3. Java keywords and basic grammar
1. Keywords: Strings (words) given special meanings by the Java language and used for special purposes. These keywords cannot be used for the names of constants, variables, and any identifiers. .
(1). Identifier: All components of Java need names. Class names, variable names, and method names are all called identifiers.
Regarding Java identifiers, there are the following points to note:.
All identifiers should be letters (AZ or az), dollar signs ( KaTeX parse error: Unexpected character:'' at position 27: …beginning. You can start after the first character It is any combination of letters (A ̲Z or az), dollar sign ( ), underscore (_) or numbers
. Keywords cannot be used as identifiers
. Identifiers are case sensitive
. Examples of legal identifiers: age, $age, _value, __age_value
. Examples of illegal identifiers: 123abc, age

2. Basic syntax: When writing Java programs, you should pay attention to the following points:
(1). Case sensitivity: Java is case sensitive, which means that the identifiers Hello and hello are different
.
.Class name: For all classes, the first letter of the class name should be capitalized. If the class name consists of several words,
then the first letter of each word should be capitalized, such as MyFirstJavaClass.
.Method name: All method names should start with a lowercase letter. If the method name contains several words,
capitalize the first letter of each word after it .
.Source file name: The source file name must be the same as the class name. When saving the file, you should use
the class name of the public class as the file name to save (remember that Java is case sensitive), and the file name suffix is ​​.java. (If the file name and the class name are not the same, it will cause a compilation error).
.Main method entrance: all Java programs are
executed by the public static void main(String []args) method .
(1) Basic concepts in .java: .Object
: An object is an instance of a class, with state and behavior.
.Class: A class is a template that describes the behavior and state of a class of objects.
.Method: Method is behavior, a class can have many methods. Logic operations, data modification, and use actions are all done in methods.
. Instance variables: Each object has a unique instance variable, the state of the object is determined by the value of these instance variables.
(2).java variables: .local
variables.
. Class variables (static variables).
. Member variables (non-static variables).

Guess you like

Origin blog.csdn.net/Pzz_Lite/article/details/112915881