2013-02-18 16 views
0

對於下面的代碼:失蹤「」 AssignmentOperator表達」在抽象類

private double currentTime; 
private Queue<ScheduledEvent<S>> diary; 

public Simulation() { 
    diary = new PriorityQueue<ScheduledEvent<S>>; 
} 

稱爲Simulation<S>我得到以下所有的Eclipse錯誤的抽象類中

  • Syntax error on tokens, delete these tokens
  • Syntax error, insert ">>" to complete ReferenceType2
  • Syntax error, insert "AssignmentOperator Expression" to complete Assignment
  • Syntax error, insert ";" to complete BlockStatements

原因是什麼?我沒有看到任何可能導致此錯誤的拼寫錯誤或空白任務。

回答

4

因爲你缺少()

diary = new PriorityQueue<ScheduledEvent<S>>(); 

你調用構造函數,即使沒有通過,仍然需要()

任何參數