Tuesday, September 9, 2008

Apple ACPT Certification Exam 9L0-402

Now all is fine 9L0-509 and supe'cool at the moment, except for one thing that you can easily notice: there are certain chunks of code that are very similar (if not exactly the same) in the above two classes. So, in essence, you have to type in the same code at two different places! And when you update your code to include methods (functions) for handBrake() and pressHorn(), 9L0-402 Exam you'll have to do that in both the classes above.

Therefore, to escape this frustrating (and confusing) task of writing the same code at multiple locations in a single project, you use Inheritance.

Now that you 9L0-509 know what kind of problems Inheritance solves in C++, let’s examine how to implement Inheritance in our programs. As its name suggests, Inheritance lets us create new classes which automatically have all the code from existing classes. It means that if there is a class called MyClass, a new class with the name MyNewClass can be created which will have 9L0-402 Braindump all the code present inside the MyClass class. The following code segment shows it all:

No comments: