forked from submit50/submit50
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinheritance.html
More file actions
41 lines (36 loc) · 2.07 KB
/
Copy pathinheritance.html
File metadata and controls
41 lines (36 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
<title>OOPS - Inheritance</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<meta name="viewport" content="width=device-width, intial-scale=1">
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<div class="container">
<div class="row">
<div id = "header" class="col-12">
<h1>OBJECT ORIENTED PROGRAMMING</h1>
</div>
<div class="left_menu col-sm-4 col-12" >
<ul>
<li><a href="index.html">Introduction</a></li>
<li><a href="classes.html">Classes</a></li>
<li><a href="object.html">Object</a></li>
<li><a href="encapsulation.html">Encapsulation</a></li>
<li><a href="inheritance.html">Inheritance</a></li>
<li><a href="polymorphism.html">Polymorphism</a></li>
<li><a href="ref.html">References</a></li>
</ul>
</div>
<div id="content" class="col-sm-8 col-12">
<h2>Inheritance</h2>
<p>If we have several descriptions with some commonality between these descriptions, we can group the descriptions and their commonality using inheritance to provide a compact representation of these descriptions. The object-oriented programming approach allows us to group the commonalities and create classes that can describe their differences from other classes.</p>
<p>For example: if were to be given an unstructured group of descriptions such as Car, Saloon, Estate, Van, Vehicle, Motorbike and Scooter, and asked to organise these descriptions by their differences. You might say that a Saloon car is a Car but has a long boot, whereas an Estate car is a car with a very large boot. Figure 1.7 shows an example of how we may organise these descriptions using inheritance.</p>
<img src="src/inherit.jpg " class="col-sm-6 col-12">
</div>
<div id="footer" class="col-12">©ambalika2019</div>
</div>
</div>
</body>
</html>