We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d85db5 commit 9c33d96Copy full SHA for 9c33d96
India.java
@@ -0,0 +1,31 @@
1
+public class India {
2
+ public void speaking() {
3
+ System.out.println("I can speak indian languages");
4
+
5
+ }
6
7
+ public static void main(String[] args) {
8
+ India p1= new India();
9
+ India p2= new Delhi();
10
+ India p3= new kerala();
11
12
+ p1.speaking();
13
+ p2.speaking();
14
+ p3.speaking();
15
16
17
+}
18
+class Delhi extends India{
19
+ //Method Overriding
20
21
+ System.out.println("I can speak Hindi");
22
23
24
25
+class kerala extends India(){
26
+ public void speaking(){
27
+ System.out.println("I can speak malayalam");
28
29
30
31
0 commit comments