-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintro5.html
More file actions
82 lines (54 loc) · 2.31 KB
/
intro5.html
File metadata and controls
82 lines (54 loc) · 2.31 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<html>
<head>
<link type="text/css" rel="stylesheet" href="example.css"></link>
</head>
<body bgcolor="" >
<ul id="u1">
<li id="l1"><a class="ac" href="Home.html" id="a1"><b>Home</b></a></li>
<li id="l1"><a href="AboutUs.html" id="a2"><b>About Us</b></a></li>
<li id="l1"><a href="#contact" id="a2"><b>History of Java</b></a></li>
<li id="l1"><a href="#about" id="a2"><b>Objectives</b></a></li>
</ul>
<table>
<tr>
<td align="left" valign="top">
<a href="intro.html"><img src="image/jj.jpg" width="150" height="150"></a><br>
<a href="intro2.html"><img src="image/j2.jpg" width="150" height="150"></a><br>
<a href="intro8.html"><img src="image/j3.jpg" width="150" height="150"></a><br>
<a href="intro3.html"><img src="image/j4.jpg" width="150" height="150"></a><br>
<a href="intro4.html"><img src="image/j5.jpg" width="150" height="150"></a><br>
<a href="intro5.html"><img src="image/j6.jpg" width="150" height="150"></a><br>
<a href="intro6.html"><img src="image/j7.jpg" width="150" height="150"></a><br>
<a href="intro7.html"><img src="image/j8.jpg" width="150" height="150"></a><br>
</td>
<td align="left" valign="top">
<pre>
<center><font face="Times New Roman"size="8" color="blue">What is Method overriding?</font></center>
<font face="Times New Roman" size="4">
If subclass (child class) has the same method as declared in the parent class, it is known as
method overriding in java.
In other words, If subclass provides the specific implementation of the method that has been
provided by one of its parent class, it is known as method overriding.
Usage of Java Method Overriding
• Method overriding is used to provide specific implementation of a method that is already
provided by its super class.
• Method overriding is used for runtime polymorphism
Rules for Java Method Overriding
1. method must have same name as in the parent class
2. method must have same parameter as in the parent class.
3. must be IS-A relationship (inheritance).
<b>Example</b>
<a href="V.html">overriding</a>
<b>Example</b>
<a href="ov.html">overriding2</a>
</a>
</font>
</td>
<td align="right" valign="top">
.<br><br><br><br><br><br>
<img src="image/aa.jpg" width="300" height="450">
</td>
</tr>
</table>
</body>
</html>