An Introduction to C# and .NET Framework
Recursive Method Call ( A method can call itself.
Access Specifier
Return type
Method name
Parameter List
Method body )
Recursive
Arrays
Inheritance
C++ logic
polymorphism
9. Inheritance
One of the most important concepts
Inheritance allows us to define a class
in terms of another class
makes it easier to create and maintain
an application
Base and Derived Classes
11. C++ logic
In C we had to code our own bugs. In C++ we can inherit them.
12. C# - Polymorphism
The word polymorphism means
having many forms
'one interface, multiple functions'.
Static (In static polymorphism, the
response to a function is determined
at the compile time)
Dynamic(In dynamic polymorphism,
it is decided at run-time.)
13. Static Polymorphism
C# provides two techniques to implement static
polymorphism.
Function overloading
Operator overloading
Function Overloading
You can have multiple definitions for the same function name in the
same scope
15. Dynamic Polymorphism
C# allows you to create abstract classes that are used to
provide partial class implementation of an interface
Abstract classes contain abstract methods
The derived classes have more specialized functionality.
rules about abstract classes
You cannot create an instance of an abstract class
You cannot declare an abstract method outside an abstract
class
When a class is declared sealed, it cannot be inherited,
abstract classes cannot be declared sealed.
17. Polymorphism Fact
A dog, a spider, and a human can all walk at a rate of
speed. Everyone knows this. But, when talking about the
specifics of how they walk, each implementation is
different. A spider has 8 legs and will 'scurry' around very
quickly ( relative ). A dog has 4 legs and will leap and
jump and run around. A human has 2 legs and will place
one in front of the other, enabling them to walk.