- Design Patterns and Best Practices in Java
- Kamalmeet Singh Adrian Ianculescu LUCIAN PAUL TORJE
- 185字
- 2021-06-25 20:52:27
Objects and classes
Objects are the main elements of an object-oriented programming (OOP) language. An object holds both the state and the behavior.
If we think of classes as a template, objects are the implementation of the template. For example, if human is a class that defines the behavior and properties that a human being can have, you and I are objects of this human class, as we have fulfilled all the requirements of being a human. Or, if we think of car as a class, a particular Honda Civic car will be an object of this class. It will fulfill all the properties and behaviors that a car has, such as it has an engine, a steering wheel, headlights, and so on, and it has behaviors of moving forward, moving backward, and so on. We can see how the object-oriented paradigm can relate to the real world. Almost everything in the real world can be thought of in terms of classes and objects, hence it makes OOP effortless and popular.
Object-oriented programming is based on four fundamental principles:
- Encapsulation
- Abstraction
- Inheritance
- Polymorphism (subtyping polymorphism).
- JavaScript從入門到精通(微視頻精編版)
- AngularJS Testing Cookbook
- Java系統分析與架構設計
- Angular UI Development with PrimeNG
- Learning Selenium Testing Tools with Python
- Visual Basic程序設計教程
- 深入分布式緩存:從原理到實踐
- Linux C編程:一站式學習
- ElasticSearch Cookbook(Second Edition)
- Natural Language Processing with Java and LingPipe Cookbook
- Learning YARN
- Quantum Computing and Blockchain in Business
- Creating Data Stories with Tableau Public
- Penetration Testing with the Bash shell
- Mastering Android Studio 3