Skip to content

Commit 07a3bb4

Browse files
Exception Handelling examples
1 parent 5657b11 commit 07a3bb4

14 files changed

Lines changed: 54 additions & 33 deletions

File tree

58 Bytes
Binary file not shown.
255 Bytes
Binary file not shown.
179 Bytes
Binary file not shown.
203 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
143 Bytes
Binary file not shown.
546 Bytes
Binary file not shown.

JavaTestMahesh/src/com/mahesh/abstraction/ConcerteMethod.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ abstract class AbstractDemo {
44
public void myMethod() {
55
System.out.println("Hello");
66
}
7+
78
public abstract int anotherMethod(int a);
8-
public void anotherMethod() {
99

10+
public void anotherMethod() {
11+
System.out.print("Inside Abstract method");
1012
}
1113
}
1214

@@ -16,15 +18,17 @@ public void anotherMethod() {
1618
}
1719

1820
public static void main(String args[]) {
19-
// Can't create object of abstract class - error!
2021
AbstractDemo obj = new ConcerteMethod();
2122
obj.anotherMethod();
23+
int dsa = obj.anotherMethod(32);
24+
System.out.print("Abstract method" + dsa);
25+
obj.myMethod();
2226
}
2327

2428
@Override
2529
public int anotherMethod(int a) {
26-
// TODO Auto-generated method stub
27-
return 0;
30+
System.out.print("inside Auto-generated method stub");
31+
return a;
2832
}
2933

3034
}

0 commit comments

Comments
 (0)