我试图用Java编写一个会计程序,为此我需要编写一个方法,该方法需要来自提示的会计记录。
System.out.println("Write your accounting record");
String accountingRecord= console.nextLine();
String[] parts= accountingRecord.split(" ");
// Split the String into three parts (debit,credit and ammount)
debit =parts[0];
// the debit could be an account which is declared before e.g. "Bank, Liabilities...
credit=parts[1];
//should be too an account which is declared before.
int ammount= Integer.parseInt(parts[2]);
account.accounting(debit,credit,ammount);
现在回答我的问题,静态方法"会计"期望两个对象,借记和信用对象(例如银行,负债),当然还有金额。如何输入提示对象的名称?