我正在尝试在 Scala 中执行此操作,但由于某种原因它不起作用
abstract class Room {
...
}
class RoomA1 extends Room { //"not found: type Room"
//but they're in the same package!!!
//and if I import it as Eclipse suggests the import declaration will give
//"Room is not a member of rooms(rooms.type)"
...
}
并且...
var room = new Array[Room](2)
room(0) = new RoomA1 //gives a type mismatch
//how can I accomplish this?