-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclasses.ts
More file actions
54 lines (39 loc) · 702 Bytes
/
Copy pathclasses.ts
File metadata and controls
54 lines (39 loc) · 702 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
46
47
48
49
50
51
52
53
54
interface IAccount2 {
name: string,
balance: number,
status?: string,
deposit?: () => void,
};
class InvestmentAccount0 {
name;
balance;
withdraw() {
}
}
class InvestmentAccount1 {
constructor(public name, public balance) {
}
private withdraw() {
}
}
class InvestmentAccount2 implements IAccount2 {
name;
balance;
withdraw() {
}
}
class InvestmentAccount3 implements IAccount2 {
public name;
public balance;
private withdraw() {
}
}
class InvestmentAccount4 implements IAccount2 {
constructor(
public name, public balance
) {
}
private withdraw() {
this.balance = 0;
}
}