JS object-oriented programming, how can one class and one file be related to each other like Java?

ecma6 seems to have added import, what about ecma5

js object-oriented programming

1. Object-oriented programming 1. Process-oriented and object-oriented 1) Process-oriented: Focus on the process steps of how to solve a problem. The programming feature is to realize each step of the process step by function. There is no class and Object concept. 2) Object-oriented: Focus on which object solves the problem. The programming feature is that a class appears, the object is obtained from the class, and the object solves the specific problem. For the caller, process-oriented requires the caller to implement various functions by himself. Object-oriented, only requires the caller to understand the function of the specific method in the object, and does not need to understand the implementation details in the method. 2. Three Object-Oriented Features Three Object-Oriented Features Large feature inheritance, encapsulation, polymorphism. JS can simulate inheritance and encapsulation, but it cannot simulate polymorphism, so JS is an object-based language, not an object-oriented language in the traditional sense. 3. The relationship between classes and objects 1) Classes are abstract, objects are concrete (classes are the abstraction of objects, objects are the concretization of classes) 2) Classes are an abstract concept, only It can be said that classes have attributes and methods, but they cannot assign specific properties to…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索