1
2
3
4
5
6
7
8
9
10
|
struct
Account
{
var
amount :
Double
= 0.0
//账户金额
owner :
String
=
""
//账户名
static
interestRate :
= 0.668
//利率
func
interestBy(amount :
) ->
{
return
interestRate * amount
}
}
|
class
// 账户金额
// 账户名
class
staticProp :
{
0.668
}
{
0.8886 * amount
}
}
//访问静态属性
print
(
.staticProp)
|