Avatar
import Foundation final class BankAccount { var balance: Int = 0 var test: [Int:Int] = [:] func deposit(_ amount: Int) -> Int { balance += amount test[100] = 100 Thread.sleep(forTimeInterval: 1.0) return balance } } func bankAccountMain() { let account = BankAccount() Task { print(account.deposit(100)) } Task { print(account.deposit(100)) } }
t_tensai 1
t_naruhodo 2