I organized the Java basic programming and mind map in super detail, so novices can understand it

insert image description here

Java basic programming and its mind map

Table of contents:

  • Java study map
  • 1. Basic syntax of Java
  • 1. Keywords and identifiers 2. Variable classification 3. Operators 4. Process control
  • Two, the array
  • 1. Overview of arrays 2. One-dimensional arrays 3. Two-dimensional arrays 4. Common algorithms for arrays 5. Use of Arrays tools
  • Three, object-oriented
  • The three major characteristics of Java classes and their class members (encapsulation, inheritance, polymorphism) keywords
    insert image description here

1. Basic syntax of Java

insert image description here

1. Keywords and identifiers

insert image description here

2. Variable classification

insert image description here

Define variable format

variable type variable name = variable value;
variable type variable name; variable name = variable value;

Points to note when using variables

① Variables must be declared first, and then used
② Variables are defined within their scope. Within scope, it's valid. In other words, if it goes out of scope, it becomes invalid
③ In the same scope, two variables with the same name cannot be declared

Basic data variable operation rules

Automatic type conversion: Conclusion: When a variable of a small-capacity data type is operated on with a variable of a large-capacity data type, the result is automatically promoted to a large-capacity data type. byte, char, short --> int --> long --> float --> double Special: When the three types of variables of byte, char, and short are operated, the result is int type

Explanation: The capacity at this time refers to the large and small range of the indicated number. For example: float capacity is greater than long capacity

Mandatory type conversion:
1. You need to use a strong escape character: ()
2. Points to note: mandatory type conversion may result in loss of precision.

3. Operators

insert image description here
Arithmetic operators: + - + - * / % (before)++ (behind)++ (before)-- (before)-- +
Special instructions:
1. (before)++: first increment by 1, then operate
(Later)++ : Calculate first, then increment 1
2. (Before)-- : Decrement 1 first, then calculate
(after)-- : Calculate first, then decrement 1
3. Connector: +: only Used between String and other data type variables.

Copy operator: = += -= *= /= %=
Special instructions:
1. The result of the operation will not change the data type of the variable itself
2.
During development, if you want the variable to achieve +1 operation, how many methods are there? (Prerequisite: int num = 10;)
//Method 1: num = num + 1;
//Method 2: num += 1;
//Method 3: num++; (recommended)

Comparison operators: == != > < >= <= instanceof

4. Process control

insert image description here

keywords

Keyword: this

1. Structures that can be called: attributes, methods; constructors

2.this calls properties and methods:
this is understood as: the current object or the object currently being created

2.1 In the method of the class, we can use "this.property" or "this.method" to call the current object property or method. But usually, we choose to omit "this.". In special cases, if the formal parameter of the method has the same name as the attribute of the class, we must explicitly use the "this.variable" method to indicate that the variable is an attribute, not a formal parameter.

2.2 In the class constructor, we can use "this.property" or "this.method" to call the object property or method currently being created. However, under normal circumstances, we all choose to omit "this.". In special cases, if the formal parameter of the constructor has the same name as the attribute of the class, we must explicitly use the "this.variable" method to indicate that the variable is an attribute rather than a formal parameter.

3.this calls the constructor:

① In the constructor of the class, we can explicitly use the "this (parameter list)" method to call other constructors specified in this class. ② The constructor cannot call itself through the "this (parameter
list)" method
③ If there are n constructors in a class, at most n - 1 constructors use "this (parameter list)"
④ It is stipulated that "this (parameter list)" must be declared at the first line of the current constructor
⑤ Inside the constructor, at most one "this (parameter list)" can be declared to call other constructors

Keyword: abstract
abstract: abstract
1. Can be used to modify: class, method
2. Concrete:
abstract modified class: abstract class

  此类不能实例化
 抽象类中一定有构造器,便于子类实例化时调用(涉及:子类对象实例化的全过程)
  开发中,都会提供抽象类的子类,让子类对象实例化,完成相关的操作 --->抽象的使用前提:继承性
123

abstract modification method: abstract method

抽象方法只方法的声明,没方法体
包含抽象方法的类,一定是一个抽象类。反之,抽象类中可以没有抽象方法的。
   若子类重写了父类中的所的抽象方法后,此子类方可实例化
   若子类没重写父类中的所的抽象方法,则此子类也是一个抽象类,需要使用abstract修饰
1234

3. Notes:

1. abstract cannot be used to modify: attributes, constructors and other structures
2. abstract cannot be used to modify private methods, static methods, final methods, final classes


insert image description here

Guess you like

Origin blog.csdn.net/KRYST4L123/article/details/129816706