Programming Thread

Viewing single post

Started by the-pi-guy, Mar 13, 2016, 10:39 PM

previous topic - next topic

the-pi-guy

I've been studying some of the basics.  
Objected Oriented was 5 years ago now.  I just looked over most of what I was a little unsure of.  I was familiar with the words, but I've forgotten some of the distinctions.  

Polymorphism:
There are a couple types of polymorphism.  Generically, polymorphism is where one thing can be used in multiple ways.

One type: function overloading.  
You can name multiple functions the same way, but with different parameters.
So like:
add(int, int)
add(double, double)

Another is subtyping.  

------
Another concept is abstract classes and interfaces.  

An interface is more useful when you want to share behavior, an abstract class is when you want to share code.  
In an abstract class you can basically mix methods that need to be implemented, and methods that are already programmed.  An interface is something that needs to be entirely programmed.  

-----------

Might do a post for data structures that I work with less often.