Skip to content

Commit 1cdf7a8

Browse files
Collections and threads concepts
1 parent 48db02b commit 1cdf7a8

File tree

13 files changed

+31
-48
lines changed

13 files changed

+31
-48
lines changed
-179 Bytes
Binary file not shown.
70 Bytes
Binary file not shown.
-199 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
7 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
-961 Bytes
Binary file not shown.

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,20 @@ class Demo2 extends Demo1 {
1313
* don't declare abstract method of super class compiler would throw an
1414
* error
1515
*/
16-
public void disp2() {
17-
System.out.println("I'm overriding abstract method");
18-
}
16+
1917

2018
public static void main(String args[]) {
2119
Demo2 obj = new Demo2();
2220
obj.disp1();
2321
obj.disp2();
2422
}
2523

24+
@Override
25+
public void disp2() {
26+
// TODO Auto-generated method stub
27+
28+
}
29+
2630
// @Override
2731
// public void disp2() {
2832
// // TODO Auto-generated method stub

JavaTestMahesh/src/com/mahesh/exceptionHandelling/Example.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ public Example(String message) {
1717
public String getSubMessage() {
1818
return subMessage;
1919
}
20-
20+
public long get(){
21+
return 0;
22+
}
2123
public static void main(String[] args) {
2224
Example exampleClass = new Example("Test");
2325
System.out.println(exampleClass.getSubMessage());

JavaTestMahesh/src/com/mahesh/interfaces/Interf.java

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
interface MyInterface {
44
abstract void method1();
55

6-
void method2();
6+
void method2();
77
}
88

9-
interface MyInterface1 {
10-
public void method3();
9+
interface MyInterface1 {
10+
public void method1();
1111

12-
public void method4();
13-
}
12+
public void method4();
13+
}
1414

15-
class Interf implements MyInterface,MyInterface1{
15+
class Interf implements MyInterface, MyInterface1 {
1616

1717
public static void main(String arg[]) {
1818
System.out.println("inside mainmethod");
19-
MyInterface obj = new Interf();
19+
Interf obj = new Interf();
2020
obj.method1();
2121
obj.method2();
22-
MyInterface1 obj1 = new Interf();
23-
obj1.method3();
24-
obj1.method4();
22+
// MyInterface1 obj1 = new Interf();
23+
// obj1.method3();
24+
obj.method4();
2525
}
2626

2727
public void method1() {
@@ -32,16 +32,10 @@ public void method2() {
3232
System.out.println("inside method 2");
3333
}
3434

35-
@Override
36-
public void method3() {
37-
// TODO Auto-generated method stub
38-
39-
}
40-
4135
@Override
4236
public void method4() {
4337
// TODO Auto-generated method stub
44-
38+
4539
}
4640

4741
}

0 commit comments

Comments
 (0)