我試圖通客戶數據到一個表。但是,在編寫此私有方法時,我不斷收到上面的錯誤消息。我對Java相當陌生。任何幫助?「陣列維度缺失,預計‘;’」
private void addCustomerToTable(Customer customer){
DefaultTableModel model = (DefaultTableModel) accountTable.getModel();
model.setRowCount(model.getRowCount()+1);
model.addRow(new Object[] (customer.getFirstName(),
customer.getLastName(), customer.getAccount().getAccountNumber(),
customer.getAccount().getBalance()));
}
'新的對象[] { customer.getFirstName(), customer.getLastName(),customer.getAccount()。getAccountNumber(), customer.getAccount()。所以getBalance()}' – Eran
請注意@Eran的評論中使用括號而不是括號。 –