[Java Basics] Is the foundation that major manufacturers have begun to attach importance to? Come and join the basic learning, consolidate the details, and brush the interview questions.

An overview of the overall language of the course

1. Java basic knowledge diagram

insert image description here

2. Overall overview of Java

Part 1 : Core structure of programming language
Main knowledge points: variables, basic syntax, branches, loops, arrays, ...
Part 2 : Java object-oriented core logic
Main knowledge points: encapsulation, inheritance, polymorphism, interfaces, ...
Part 3 : Development of Java SE advanced applications
Main knowledge points: exceptions, collections, I/O, multithreading, reflection mechanism, network programming, ...
Part 4 : Training projects
Project 1: Household income and expenditure accounting software
Project 2: Clients Information management software
Item: Development team personnel scheduling software
Additional item 1: Banking business management software
Attachment item 2: Stand-alone exam management software

3. Learning experience

insert image description here

An overview of the Java language

1. Basic knowledge

Software : Software is a collection of computer data and instructions organized in a specific order. There are system software and application software.
Human-computer interaction mode : Graphical User Interface GUI is simple and intuitive, easy for users to accept, and easy to operate. Command Line Interface CLI: You need to have a console, enter specific commands, and let the computer complete some operations. It is more troublesome, and some commands need to be recorded.

2. Common DOS commands

•Commonly used DOS commands
dir : list files and folders in the current directory
md : create a directory
rd : delete a directory
cd : enter the specified directory
cd... : return to the previous directory
cd: return to the root directory
del : delete a file
exit : Exit the dos command line
• Supplement: echo javase>1.doc
• Common shortcut keys
← →: move the cursor
↑ ↓: recall historical operation commands
Delete and Backspace: delete characters

3. The iterative history of the development of computer languages

• First Generation Language
Machine language. Instructions exist in binary code.
• Second generation language
Assembly language. Use a mnemonic to represent a machine instruction.
insert image description here
• Third-generation languages: high-level languages
​​C, Pascal, Fortran, process-oriented languages,
C++, process-oriented/object -oriented
Java, cross-platform pure object-oriented languages
, .NET, cross-language platforms
, Python, Scala…

4. Java language version iteration overview

It is an Internet-oriented programming language. Java was initially attractive because Java programs could be
run in a web browser. These Java programs are called Java
applets. An applet uses a modern graphical user interface to interact with Web users. The applet is embedded in HTML code.
As Java technology continues to mature on the web, it has become a Web application The first development language of
.1991 Green project, the development language was originally named Oak (Oak) In
1994, the development team realized that Oak is very suitable for the Internet
.
, released JDK 1.1, the JavaOne conference was held, which was the largest conference of its kind in the world at that time.
In 1998, JDK 1.2 was released, and the enterprise platform J2EE was released in the same year.
In 1999, Java was divided into J2SE, J2EE and J2ME, and JSP/Servlet technology was born
. Type version: JDK 1.5, in order to highlight the importance of this version, it was renamed JDK 5.0
2005, J2SE -> JavaSE, J2EE -> JavaEE, J2ME -> JavaME
2009, Oracle Corporation acquired SUN, transaction price of 7.4 billion US dollars
2011 , Released JDK 7.0
In 2014, released JDK 8.0, which is the version with the biggest changes since JDK 5.0
In 2017, released JDK 9.0 to maximize modularity
In March 2018, released JDK 10.0, the version number is also known as 18.3
In September 2018, JDK 11.0 was released, the version number is also known as 18.9

5. The field of Java language application

From the application field of Java, the application direction of Java language is mainly manifested in the following aspects:
• Enterprise-level application: mainly refers to the software systems of complex large enterprises and various types of websites. Java's security mechanism and
its cross-platform advantages make it widely used in the development of distributed systems. Application areas include finance, telecommunications
, transportation, e-commerce, etc.
• Android platform applications: Android applications are written in the Java language. The level of Android development
largely depends on whether the core competence of the Java language is solid.
• Big data platform development: various frameworks Hadoop, spark, storm, flink, etc. In terms of this kind of technology ecosystem
, there are also various middleware such as flume, kafka, sqoop, etc. Most
of these frameworks and tools use Java It is written, but provides various language APIs such as Java, scala, Python, R, etc. for programming.
• Application in the mobile field: mainly in the consumer and embedded fields, and refers to the application in various small devices, including mobile
phones, PDAs, set-top boxes, and automotive communication equipment.

6. Features of the Java language

• The Java language is easy to learn. The syntax of the Java language is very close to the C and C++ languages, making it easy for most programmers to learn and use Java.
• The Java language is mandatory object-oriented. The Java language provides primitives such as classes, interfaces and inheritance. For the sake of simplicity, it only supports single inheritance between classes, but supports multiple inheritance between 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. In the basic Java application programming interface, a network application programming interface (java net) provides a class library for network application programming, including URL, URLConnection, Socket, ServerSocket, etc. Java's RMI (The remote method activation mechanism is also an important means of developing distributed applications)
• The Java language is robust. Java's strong type mechanism, exception handling, automatic garbage collection, etc. are important guarantees for the robustness of Java programs. The discarding of pointers is Java wise choice.

3. Construction of development environment (key points)

1. The relationship between JDK, JRE, and JVM

insert image description here
• JDK = JRE + Java development tools (javac.exe, java.exe, javadoc.exe)
• JRE = JVM + Java SE standard class library

insert image description here

2. JDK download and installation

•Official website:
link: www.oracle.com
link: java.sun.com
•Install JDK
fool installation, the next step is OK.
Suggestion: Do not use special symbols such as Chinese or spaces in the installation path.
If the operating system is 64-bit, the software should try to support 64-bit (unless the software itself is indistinguishable.
When prompted to install JRE, it is normally installed during the JDK installation, but in order to use Eclipse and other development tools later without reporting errors, it is recommended that Also install JRE as prompted).

3. Configuration of the .path environment variable

  1. Why configure the path environment variable?
    Type javac in the dos command line, and an error message appears:
    insert image description here
    Error reason: If the currently executing program does not exist in the current directory, the windows system will search in the directory specified by an environment variable named path in the system. If it is still not found, the above error message will appear. So enter the jdk installation path \bin directory, execute javac, you will see the javac parameter prompt information.
    insert image description here
    2 How to configure?
    It is very troublesome to enter the bin directory every time the java tool is executed. Is it possible to execute java tools in any directory?
    According to the principle that the windows system searches for executable programs, you can define the path where the java tool is located in the path environment variable, and let the system help us find the program to run and execute.
    Configuration method:
    My Computer - Properties - Advanced System Settings - Environment Variables
    Edit the path environment variable, add the directory where the java tool is located at the beginning of the variable value, and separate it with ";" and other values.
    Open the DOS command line and type javac in any directory. If the parameter information of javac appears, the configuration is successful.
    insert image description here
    insert image description here

Fourth, the first Java program

1. Development experience - HelloWorld

public class Hello {
    
    
	public static void main(String[] args) {
    
    //public static void main(String a[]) {//arguments:参数
		System.out.print("Hello World!");
		System.out.println();//换行
		System.out.println("Hello World!");
		}
}

1.
Write the java code we will write in a source file ending with ".java"
2. Compile:
Use the javac.exe command to compile our java source file. Format: javac source filename.java
3. Run:
use the java.exe command to interpret and run our bytecode file. Format: java class name

2. Solutions to common problems

insert image description here
insert image description here
Summary:
The easiest mistakes to make when learning to program are syntax errors. Java requires you to write code according to the grammar rules.
If your program violates grammar rules, such as: forgetting semicolons, braces, quotation marks, or misspelling a word, the java compiler will report a syntax error. Try to understand the error messages the compiler will report .

3. Summarize the first program

1. Multiple classes can be declared in a java source file. However, at most one class can be declared public.
And it is required that the class name of the class declared as public must be the same as the source file name.
2. The entry to the program is the main() method. The format is fixed.
3. Output statement:
System.out.println(): output data first, then line feed
System.out.print(): output data only
4. Each line of execution statement ends with ";".
5. Compilation process: After compilation, one or more bytecode files will be generated. The filename of the bytecode file is the same as the class name in the java source file.

5. Comments and API documentation, etc.

1. Notes

Classification : single-line comments (//comment text), multi-line comments (/* comment text*/), documentation comments (java-specific)
Function : Improve the readability of the code; an important way to debug programs. Comments are a good programming habit that a programmer must have. Sort out your thoughts through comments first, and then use code to reflect them.
The role of single-line comments and multi-line comments : to explain the program written to enhance readability. Convenience for yourself and convenience for others. Debug the code written.
Features :
single-line comments and multi-line comments, the commented content does not participate in compilation.
In other words, the bytecode file at the end of .class generated after compilation does not contain commented-out information.
The comment content can be parsed by the tool javadoc provided by the JDK to generate a set of description documents of the program in the form of web files.

2. Java API Documentation

•API (Application Programming Interface, application programming interface is
the basic programming interface provided by Java.
•Java language provides a large number of basic classes, so Oracle also provides corresponding
API documents for these basic classes to tell developers how to use These classes, as well as the methods contained in these classes.
• Download API:
Link: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Additional Resources-Java SE 8 Documentation download.
• See details : JDK8 download-installation-configuration.doc

3. Good programming style

insert image description here

6. Description of development tools

1. Text editing tools

Notepad
UltraEdit
EditPlus
TextPad
NotePad

2. Java Integrated Development Environment (IDE)

JBuilder
NetBeans
Eclipse
MyEclipse
IntelliJ IDEA

Guess you like

Origin blog.csdn.net/weixin_56321113/article/details/123341070