With the majority of programmers, the inheritance and encapsulation in OOP is quite easy to understand also polymorphic properties when new approach will find it hard to understand a bit more. However here again is a property can say is contained most of the power of object-oriented programming. Learn a simple way: polymorphism is the concept that two or more classes have the same method but can be implemented in different ways.Polymorphic properties as above is a very powerful properties because it gives the code the ability to generalize. We do not need to create a style for each method inherited from the superclass Smartphone that simply getting a Smartphone type variable and can work with any class inheriting from it. The only thing not done here is use the method only to be declared on the class of theFor example, in the section on, each class inheriting from a smartphone Smartphone but can store data on the cloud in different ways:AndroidPhone archives using Google DriveThe iPhone saved on iCloudWindowsPhone using SkyDrive.
đang được dịch, vui lòng đợi..