We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d940c16 commit 723ce92Copy full SHA for 723ce92
OOPs/Polymorphism/Method_Overriding.java
@@ -0,0 +1,27 @@
1
+/*
2
+ Method overriding : If derived class has the same method as declared in the base class, it is known as method overriding.
3
+*/
4
+
5
+class base
6
+{
7
+ void display()
8
+ {
9
+ System.out.println("This is base class display method");
10
+ }
11
+}
12
+class derived extends base
13
14
+ void display() //overriding base class display method
15
16
+ System.out.println("This is derived class display method");
17
18
19
20
+public class meth_overiding {
21
+ public static void main(String[] args)
22
23
+ derived dob = new derived();
24
+ base bob = new base();
25
+ dob.display();
26
27
0 commit comments