forked from Haresh1204/Algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoan.java
More file actions
45 lines (41 loc) · 769 Bytes
/
Loan.java
File metadata and controls
45 lines (41 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import java.util.ArrayList;
import java.util.Date;
public class Loan
{
public static void main(String[] args)
{
ArrayList<Object> arr_list = new ArrayList<Object>();
arr_list.add(new Loan(10000));
arr_list.add(new Date());
arr_list.add(new String("Practical"));
arr_list.add(new Circle(3.45));
for (int i = 0; i < arr_list.size(); i++)
{
System.out.println((arr_list.get(i)).toString());
}
}
}
class Circle
{
double radius;
Circle(double r)
{
this.radius=r;
}
public String toString()
{
return "Circle with Radius "+this.radius;
}
}
class Loan
{
double amount;
Loan(double amt)
{
this.amount=amt;
}
public String toString()
{
return "Loan with Amount "+this.amount;
}
}