Java (1): object oriented

Java review notes (I): object oriented

0. How to understand "everything is an object"

1. Within the scope of Java language, we encapsulate functions into classes and call specific functions through class instantiation.

2. When Java interacts with the front end, it converts tags in HTML into objects

3. When Java interacts with the backend, tables in the database are converted into objects

0. Preface:

1. Classes and members of classes

1.0 classes and objects

修饰符 class 类名{
    属性声明;
    方法声明;
}

1.1. Properties

1.2 method

1. Explain
2. Grammar
权限修饰符 [static、final] 返回值类型 方法名(形参列表){
    方法体;
    return 返回值;
}
3. Classification of classes
4. Method overload
5. Variable number of formal parameters
6. Value transfer mechanism of method parameters ★★★★
7. Recursion of method

1.3. Constructor

1.4 code block

1.5 internal

1.6 order of attribute assignment

① Default initialization

② Display initialization = = code block initialization

③ Constructor initialization

④ By object Formal assignment of property / method

1.7、JavaBean

1.8 UML class diagram

2. Three characteristics of object oriented

2.1. Packaging

2.2 succession

1. Introduction of inheritance
2. Override / overwrite

2.3 polymorphism

1. Embodiment of polymorphism
2. Application of polymorphism
3. Virtual method call ★★★★★
4、instanceof

3. Other keywords

3.1、this

3.2、super

3.3、package

3.4、import

3.5、static

3.6、final

3.7、abstract★★★★★

3.8、interface★★★★★

3.9 instructions for main()

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>