Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/343.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java “失踪”&引用;赋值运算符表达式“;抽象课堂?_Java_Assignment Operator - Fatal编程技术网

Java “失踪”&引用;赋值运算符表达式“;抽象课堂?

Java “失踪”&引用;赋值运算符表达式“;抽象课堂?,java,assignment-operator,Java,Assignment Operator,对于以下代码: private double currentTime; private Queue<ScheduledEvent<S>> diary; public Simulation() { diary = new PriorityQueue<ScheduledEvent<S>>; } 专用双电流时间; 私人队列日志; 公共模拟(){ 日记=新优先队列; } 在一个名为Simulation的抽象类中,我得到了以下所有Eclipse

对于以下代码:

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

public Simulation() {
    diary = new PriorityQueue<ScheduledEvent<S>>;
}
专用双电流时间;
私人队列日志;
公共模拟(){
日记=新优先队列;
}
在一个名为
Simulation
的抽象类中,我得到了以下所有Eclipse错误

  • 令牌语法错误,请删除这些令牌
  • 语法错误,请插入“>>”以完成引用类型2
  • 语法错误,插入“AssignmentOperator Expression”以完成赋值
  • 语法错误,请插入“;”以完成BlockStatements

原因是什么?我没有看到任何可能导致这种情况的打字错误或空作业。

因为您缺少
()

diary=newpriorityqueue();

您正在调用构造函数,即使没有传递任何仍然需要
()
的参数,因为您缺少
()

diary=newpriorityqueue();
您正在调用构造函数,即使没有传递仍然需要
()

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