steppinthrax
Diamond Member
I understand that Encapsulation simply means the language has the ability to "seperate" or allow the creation of modules where the internal functionality of each function or class is irrelavent to the designer. In other words all you need to care about is the inputs and outputs of the function or class. I.E. the black box.... Am I correct?
In Inheratance you create a parent class with operators and create a child class or subclass with operators. You call a method within the child class to inheret operators of the parent class. I saw example codes of this being done in JavaScript. What I'm confused about is it seems polymorphism is pretty similar to Inheritance in the fact that you can have the subclass inherite operators from the parent class and Over-ride the operators from the parent class. It seems like you are Inheriting and polymorphism at the same time????
Can you Inherit but not polymorph????
In Inheratance you create a parent class with operators and create a child class or subclass with operators. You call a method within the child class to inheret operators of the parent class. I saw example codes of this being done in JavaScript. What I'm confused about is it seems polymorphism is pretty similar to Inheritance in the fact that you can have the subclass inherite operators from the parent class and Over-ride the operators from the parent class. It seems like you are Inheriting and polymorphism at the same time????
Can you Inherit but not polymorph????