-7
這是我想做的事:C#如何在不創建實例的情況下訪問變量?
public class Worker
{
public int wage;
public void pay()
{
Economy.money -= this.wage;
// I want the money(of the economy) to be subtracted by the wage of the worker.
}
}
public class Economy
{
public int money;
}
我想,如果我能有超過1個經濟。
所以我想把工人的工資減去經濟(工人所屬的)的錢。
我該怎麼做?
我瘦了,您必須先在此處發佈您的作業 –