LinkedIn principal author Doug Winnie explains how you can extend classes in object-oriented programming. Using a class, you can extend it to add unique members to the class while still preserve the existing members of the base class. Using classes and extending them creates a class hierarchy that you can use to build and plan out the code in your project.
- When you create a class,…you aren't limited to just that class.…Using that basic blueprint,…you can improve that blueprint…and add more capabilities to it.…Take, for example, a class that defines an animal.…An animal has weight, color, or hair color,…a gender and an age.…An animal needs to do some basic things.…It needs to eat, sleep and move.…But different animals can extend that definition.…A cat can run, a fish can swim and a bird can fly.…
By using a class for an animal, we can extend it…and add new capabilities to a class, while at the same time,…bring along everything that is part of another class.…So if we have the animal class,…I can create a cat class that extends the animal class.…In the cat class, I can create a run method.…And everything else that is…part of an animal is part of the cat.…The same thing works for a fish or a bird.…In each one I add what is unique to that class.…
And I extend the animal class.…As a result, you end up with a hierarchy.…You have a class that starts everything.…Often in programming languages,…
Join Doug Winnie as he explains the principles of programming and helps you connect to core concepts by exploring three ways that programmers perform their jobs. Doug starts by sharing the history of coding and then dives into functions, values, variables, and parameters used to define actions. He covers capturing input from users, creating conditional tests, using loops with arrays, and object-oriented programming basics. He also takes you beyond programming, into processes like debugging, refactoring, and building iteratively.
- Working with values and variables
- Breaking down tasks
- Customizing functions and parameters
- Building conditional tests
- Creating and changing arrays
- Working with objects and classes
- Debugging and refactoring code
- Going beyond the code as a programmer
Skill Level Beginner
1. Control Computers with Code
2. Define Actions Using Code
3. Repeat Actions and Test for Conditions
4. Objects and OOP
5. Beyond Programming
Debug problems2m 50s
Next steps1m 19s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.