2013-04-28 49 views
-1

無法解析爲類型。聲明一個對象類型數組時聲明這個錯誤。我已經聲明瞭變量Drumkit,並且通過以下語句創建了一個數組:Drumkit [] dArray;Object Array無法解析爲類型

+0

'Object []'不能轉換成任何其他'[]' – Justin 2013-04-28 05:08:06

+3

你能顯示一些代碼嗎? – Justin 2013-04-28 05:08:28

+2

我們可以有一些代碼嗎? – 2013-04-28 05:15:18

回答

1

讓我Google給你。

  1. Saving objects in files produces error: "FileOutputStream cannot be resolved to a type"
  2. http://java.syntaxerrors.info/index.php?title=Foo_cannot_be_resolved_to_a_type
  3. http://dev-answers.blogspot.in/2009/06/eclipse-build-errors-javalangobject.html
  4. http://www.daniweb.com/software-development/java/threads/173636/cannot-be-resolved-to-a-type

的共識似乎是,原因是下列之一:

  1. import你的班級。你輸入了import net.whatever.DrumKit嗎? (鏈接#1,#2)
  2. 顯然有某種Eclipse錯誤,這可能(很低的機會)會影響你。 (鏈接#3)
  3. Typo'ing類名。是Drumkit還是DrumKit還是別的? (link#4)
  4. 如果Drumkit是一個變量,試圖用它作爲一個類(如Drumkit [] dArray)是無稽之談。 (我的理論)