This week's lab will be on Inheritance. For the pre-lab, I am asking you to preview some materials on inheritance. Because we have not covered it in the lab yet, it is alright if the materials do not make complete sense. But, be sure to post in the discussion what parts are confusing to you and if you come up with any questions. Please watch this video. Some of the definitions come up pretty fast, so I would recommend pausing it to read them. https://www.youtube.com/watch?v=v9Qb73QdvoE This next video shows a bit more about why we use inheritance and what polymorphism is. Just as a refresher on some terminology. Structured programming refers to just using a main method and other methods to create and run a program. Object Oriented Program (OOP) is using Classes and Objects to group variables and methods together into a single structure. https://www.youtube.com/watch?v=gWpg3yMiL0M In the video above, the functionality of a method for the child class is changing from the original parent implementation. Changing functionality from the parent class is called Polymorphism. What topic that we already covered can help a class make its own version of a method, with different functionality than the original? Find and read one article on Inheritance and post it as part of your discussion. Some of these articles can be pretty lengthy, I am expecting that you spend about 5-10 min on this part of the assignment, so If you only read part of an article that is fine. In your own words what is inheritance? The example in the video mentioned how an account can be the parent of both savings and checking. Can you give an example of inheritance in the real world? What questions do you currently have on Inheritance or Polymorphism.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
This week's lab will be on Inheritance. For the pre-lab, I am asking you to preview some materials on inheritance. Because we have not covered it in the lab yet, it is alright if the materials do not make complete sense. But, be sure to post in the discussion what parts are confusing to you and if you come up with any questions.
- Please watch this video. Some of the definitions come up pretty fast, so I would recommend pausing it to read them. https://www.youtube.com/watch?v=v9Qb73QdvoE
- This next video shows a bit more about why we use inheritance and what polymorphism is. Just as a refresher on some terminology. Structured
programming refers to just using a main method and other methods to create and run a program. Object Oriented Program (OOP) is using Classes and Objects to group variables and methods together into a single structure. https://www.youtube.com/watch?v=gWpg3yMiL0M - In the video above, the functionality of a method for the child class is changing from the original parent implementation. Changing functionality from the parent class is called Polymorphism. What topic that we already covered can help a class make its own version of a method, with different functionality than the original?
- Find and read one article on Inheritance and post it as part of your discussion. Some of these articles can be pretty lengthy, I am expecting that you spend about 5-10 min on this part of the assignment, so If you only read part of an article that is fine.
- In your own words what is inheritance? The example in the video mentioned how an account can be the parent of both savings and checking. Can you give an example of inheritance in the real world?
- What questions do you currently have on Inheritance or Polymorphism.
Inheritance is an important building block of object oriented programming.
It is a mechanism by which one class is allowed to inherit the features like fields and methods of another class.
simply, one class inherits properties of other class.
Real time example:
I want to read a book.
1. I will go to book shop and i will buy new book.
2. I will ask my friend for book.
Different types of inheritance:
a. single inheritance
b. multilevel inheritance
c. Hierarchical inheritance
d. Hybrid inheritance
Trending now
This is a popular solution!
Step by step
Solved in 2 steps