Code abuse me times, I want to code like first love.
1.1 Basic knowledge
Software development
- Software: A collection of computer data and instructions organized in a specific order. There are system software and application software points.
Interactive mode:
- Graphical interface This method is simple and intuitive, easy to accept and easy to use.
- Command-line mode: You need to have a console, enter specific instructions, and let the computer do some work. More trouble, need to record some commands.
Common DOS commands
- Dir: Lists the files and folders in the current directory
- MD: Creating a Directory
- RD: Deleting a directory
- CD: Enter the specified directory
- Cd.. : Back to the top level directory
- Cd\: Go back to the root directory
- Del: Delete Files
- Exit: Exit DOS command line
What is computer language
- Language: It is a way of communication between people. For example: Chinese and Chinese communicate in Mandarin, and if the Chinese want to communicate with the Americans, then they need to learn English.
- Computer language: The way people communicate with computers.
If the person wants to communicate with the computer, then must study the computer language. There are many kinds of computer languages, such as: c,c++,java,php, etc.
1.2Java Language Overview
Classification of computer languages
- First-generation languages
Machine language
- Second-generation languages
Assembly
- Third-generation languages
C, Pascal, Fortran and other process-oriented languages
C + + process/Object oriented
Java cross-platform, purely object-oriented language
. NET cross-language platform
The birth and characteristics of the Java language
In the development of the "Green" project, the Java parent jamesgosling team found that C lacked a garbage collection system, as well as portable security, distributed programming, and multithreading capabilities. Finally, they want a platform that is easy to migrate to a variety of devices.
Java really inherits many components from the C and C + + languages, and can even consider Java as a product of the development and derivation of C language . For example, the Java language variable declaration, operator form, parameter passing, flow control and so on and C reason, C + + cause exactly the same. But at the same time, Java is a purely object-oriented programming language, which integrates the core of C + + language object-oriented technology. Java discards features such as the C language prone to error pointers (superseded by references), operator overloading, multiple inheritance (replaced by interfaces), and the Increment garbage collector feature is used to reclaim memory space occupied by objects that are no longer referenced. JDK1.5 also introduces generics, type-safe enumerations, variable parameters, and automatic boxing/unpacking .
Key features of the Java language
- the Java language is easy to learn . The syntax of the Java language is close to the C and C + + languages, making it easy for most programmers to learn and use Java.
- The Java language is mandatory for object-oriented . The Java language provides primitives such as classes, interfaces, and inheritance, and for simplicity only supports single inheritance between classes, but supports multiple inheritance of interfaces and supports the implementation mechanism between classes and interfaces (the keyword is implements).
- the Java language is distributed. the Java language supports the development of Internet applications and has a network application programming interface (java.net) in the basic Java application programming interface, which provides a class library for network application programming, including URLs, URLConnection, sockets, ServerSocket and so on. The RMI (remote method Activation) Mechanism of Java is also an important tool for developing distributed applications.
- the Java language is robust. Java Strong type mechanism, exception handling, garbage automatic collection, etc. are the important guarantee of Java program robustness. Discarding pointers is a wise choice for Java.
- the Java language is secure. Java is typically used in a network environment, and Java provides a security mechanism to prevent malicious code from attacking. Such as: Security guard mechanism (class ClassLoader), such as assigning different namespaces to replace the local class with the same name, byte code check.
- the Java language is architecture-neutral. Java programs (files with a. java suffix) are compiled on the Java platform into an architecture-neutral bytecode format (a file with a. class suffix), which can then be run on any system that implements the Java platform.
- The Java language is an interpreted type. as mentioned earlier, Java programs are compiled into bytecode format on the Java platform and can then be run in the interpreter of any system that implements the Java platform.
- Java is a high-performance. Java's performance is superior to those of the interpreted high-level scripting language.
- The Java language is native to multithreaded support. in the Java language, a thread is a special type of object that must be created by thread or its subclasses.
Java language Overview
- is a high-level programming language introduced by Sun (Stanford University web Company) in 1995.
- is an Internet-facing programming language.
- As Java technology continues to mature in the web, it has become the preferred development language for Web applications.
Java Technology System Platform
Java SE Standard Edition: Supports the Java platform for desktop-level applications and provides a complete Java Core API.
Java EE Enterprise Edition: is a set of solutions for developing applications in enterprise environments. The technology includes the following technologies: Servlet, JSP, etc., mainly for Web application development.
Java ME mini: A platform that supports Java programs running on mobile devices, streamlines Java APIs, and adds support for mobile devices.
Application of Java in various fields
From the Java application domain, the Java language application direction mainly manifests in the following several aspects:
- Enterprise application: Mainly refers to the complex large enterprise software system, various types of Web sites. Java's security mechanism and its cross-bar advantages make it widely used in the field of distributed system development. Application areas include finance, telecommunications, transportation, e-commerce and so on.
- Android App: Android apps are written in the Java language. The level of Android development varies greatly depending on whether the core capabilities of the Java language are solid.
- Mobile applications, mainly in the field of consumption and embedded, refers to a variety of small equipment applications, including mobile phones, PDAs, set-top boxes, automotive communications equipment.
1.3Java language operation mechanism and operation process
Features of the Java language
- Feature one: Object-oriented
Two basic concepts: classes and objects
Three properties: encapsulation, inheritance, polymorphism
- Feature Two: Robustness
Absorbs the advantages of the C + + language, but removes the parts that affect program robustness (such as pointers, memory requests and releases, etc.), providing a relatively secure memory management and access mechanism
- Feature three: cross-platform
Cross-platform: Applications written in the Java language can be run on different system platforms. "Write Once,run Anywhere".
Rationale: Simply install a Java virtual machine on the operating system that needs to run the Java application. The JVM is responsible for the Java program running in the system.
Two core mechanisms of Java
- Java Virtual machine
The JVM is a virtual computer that has instruction sets and uses different storage areas. Responsible for executing instructions, managing data, registers.
For different platforms, there are different virtual machines.
The Java Virtual machine mechanism masks the difference between the underlying platform and implements "one compile, multiple runs".
- Garbage collection mechanism
Memory spaces that are no longer in use should be reclaimed for garbage collection.
In languages such as C + +, the programmer is responsible for reclaiming useless memory.
The Java language eliminates the responsibility of the programmer to reclaim useless memory space: it provides a system-level thread to track the allocation of storage space and, when the JVM is idle, checks for and frees the storage space that can be freed.
Garbage collection is performed automatically during Java programs, and programmers cannot control and intervene precisely.
Setting up a 1.4Java language environment
- Clear what is Jdk,jre
Jdk:java Development Kit
The JDK is available to Java developers with Java development tools and JRE. So installing the JDK does not have to install the JRE separately.
Development tools: Compilation Tools (Javac.exe) packaging Tools (Jar.exe), etc.
Jre:java Operating Environment
Including the core class libraries required for Java virtual machines and Java programs, if you want to run a well-developed Java program, you will only need to install the JRE on a quarterly basis.
- Configuring Environment variables
Path:windows the path to be searched when the system executes the command.
Classpath:java the path of the class to be found when compiling and running.
- Verify success: Javac Java
1.5 Development experience
Steps:
- Write Java code in a file with a. java extension
- Compiling the Java file with the Javac command
- The generated class file is run with the Java command.
Java language Overview