Skip to content

Commit 6118e2c

Browse files
author
Adiganesh005
committed
aditya
1 parent 6ed423b commit 6118e2c

File tree

13 files changed

+104
-0
lines changed

13 files changed

+104
-0
lines changed

awsTutorial2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 6ed423bbf8f8470193c2918084ef25794bc426c6
570 Bytes
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.practice.inheritance;
2+
3+
public class Chemistry extends Department{
4+
int funds = 500;
5+
6+
public int getChemistryTotalFunds(){
7+
return funds + getTotalFunds();
8+
}
9+
10+
public int getChemistryFunds(){
11+
return funds;
12+
}
13+
}
433 Bytes
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.practice.inheritance;
2+
3+
public class Department {
4+
int funds = 500;
5+
6+
public int getTotalFunds(){
7+
return funds;
8+
}
9+
10+
}

com/practice/inheritance/Main.class

1.19 KB
Binary file not shown.

com/practice/inheritance/Main.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.practice.inheritance;
2+
3+
public class Main {
4+
5+
public static void main(String[] args) {
6+
// TODO Auto-generated method stub
7+
Department dept = new Department();
8+
System.out.println(dept.getTotalFunds());
9+
10+
Maths math = new Maths();
11+
System.out.println(math.getMathsFunds());
12+
System.out.println(math.getTotalFunds());
13+
14+
Chemistry chem = new Chemistry();
15+
System.out.println(chem.getChemistryFunds());
16+
System.out.println(chem.getChemistryTotalFunds());
17+
18+
19+
Science sci = new Science();
20+
System.out.println(sci.getScienceFunds());
21+
System.out.println(sci.getTotalFunds());
22+
23+
24+
}
25+
26+
}

com/practice/inheritance/Maths.class

529 Bytes
Binary file not shown.

com/practice/inheritance/Maths.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.practice.inheritance;
2+
3+
public class Maths extends Department{
4+
5+
int funds = 1000;
6+
7+
public int getTotalFunds(){
8+
return funds + super.getTotalFunds();
9+
10+
11+
}
12+
13+
public int getMathsFunds(){
14+
return funds;
15+
}
16+
}
537 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)