Chapter 8 object oriented programming

1. Package Package is a way to organize classes; The main purpose of using packages is to ensure the uniqueness of classes; For example, if you write a Test class in your code, then your colleagues may also write a Test class. If two classes with the same name appear, they will conflict and the code cannot be compiled. 1.1 import class ...

Posted on Mon, 22 Nov 2021 09:36:12 -0500 by gljaber

Clear use class of ES6

definitionClass is the syntax sugar of constructor and prototype chain.There are two ways to define a classclass Student { } var Student = class { }Some browsers may not be able to parse the syntax of es6 or above. At this time, you need to parse the code into the syntax recognized by the browser through babel. After the syntax of defining the ...

Posted on Sat, 20 Nov 2021 20:55:45 -0500 by GoncaloF

Inheritance in Java (important knowledge points!)

1, Inherit 1. Concept Inheritance mechanism: it is the most important means for object-oriented programming to make code reusable. It allows programmers to extend and add new functions on the basis of maintaining the characteristics of the original class, so as to produce new classes, called derived classes. Inheritance presents the hiera ...

Posted on Tue, 19 Oct 2021 00:43:40 -0400 by Jtech

Inheritance in js

1. Prototype succession Features: let the prototype of the child class point to the instance of the parent class; Put the instance of the parent class on the prototype chain of the child class. When the child class instance wants to call these properties and methods, it is actually based on__ proto__ The prototype is completed in the form of ...

Posted on Fri, 01 Oct 2021 17:48:19 -0400 by Madzz

Java Object Oriented on JavaSE Foundation

1. Java Object Oriented 1.1. What is object-oriented? OO (Object Oriented) has been studied in the 1980s with new system development model, such as Object Oriented Analysis (OOA), Object Oriented Design (OOD), Object Oriented Programming (OOP). Everything is an object for language. Objects in the real world are abstractly represented in ...

Posted on Sat, 18 Sep 2021 11:52:08 -0400 by Refused