-1
我試圖做到這一點在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?
你寫了「抽象課室」。它應該是「階級」,而不是「階級」。在評論中還是在你的程序中是錯字? – vbezhenar 2012-07-08 06:50:22
twas只是一個錯字 – adrianton3 2012-07-08 06:56:08