JAVA int 強制型別轉換錯誤提示(Cannot cast from Object to int)
2013-06-19 16:20:20
在將ANDROID原始碼匯入eclipse時,出錯提示如下:
public void addActiveCid(int cid) {
if (cidActiveList == null) {
cidActiveList = new ArrayList();
}
for (int i=0;i
if(cid == cidActiveList.get(i)) { // 行 657
return;
}
}
cidActiveList.add(cid);
Log.d(LOG_TAG, "[" + phone.getPhoneId() + "]addActiveCid("+cid+") cidActive("+cidActive+") List("+cidActiveList+")");
}
public void removeActiveCid(int cid) {
if (cidActiveList != null) {
for (int i=0;i
if(cid == cidActiveList.get(i)) { // 行667.
cidActiveList.remove(i);
}
}
}
Incompatible operand types int and Object DataConnectionTracker.java /check/frameworks/base/telephony/java/com/android/internal/telephony line 657 Java Problem
Incompatible operand types int and Object DataConnectionTracker.java /check/frameworks/base/telephony/java/com/android/internal/telephony line 667 Java Problem
將 if(cid == cidActiveList.get(i))加入強制轉換int後,即
if(cid == (int)cidActiveList.get(i))
又出現如下錯誤提示:
Cannot cast from Object to int DataConnectionTracker.java /check/frameworks/base/telephony/java/com/android/internal/telephony line 657
public void addActiveCid(int cid) {
if (cidActiveList == null) {
cidActiveList = new ArrayList();
}
for (int i=0;i
if(cid == cidActiveList.get(i)) { // 行 657
return;
}
}
cidActiveList.add(cid);
Log.d(LOG_TAG, "[" + phone.getPhoneId() + "]addActiveCid("+cid+") cidActive("+cidActive+") List("+cidActiveList+")");
}
public void removeActiveCid(int cid) {
if (cidActiveList != null) {
for (int i=0;i
if(cid == cidActiveList.get(i)) { // 行667.
cidActiveList.remove(i);
}
}
}
Incompatible operand types int and Object DataConnectionTracker.java /check/frameworks/base/telephony/java/com/android/internal/telephony line 657 Java Problem
Incompatible operand types int and Object DataConnectionTracker.java /check/frameworks/base/telephony/java/com/android/internal/telephony line 667 Java Problem
將 if(cid == cidActiveList.get(i))加入強制轉換int後,即
if(cid == (int)cidActiveList.get(i))
又出現如下錯誤提示:
Cannot cast from Object to int DataConnectionTracker.java /check/frameworks/base/telephony/java/com/android/internal/telephony line 657
相關文章
- 強制型別轉換(int)、(int&)和(int*)的區別型別
- 型別轉換(int 和 String)型別
- java型別轉換與強制型別轉換(轉)Java型別
- Python做int()強制型別轉換的時候,小數是如何取捨的?Python型別
- java基礎:型別轉換castJava型別AST
- C++強制型別轉換:static_cast、dynamic_cast、const_cast、reinterpret_castC++型別AST
- 型別轉換(cast)型別AST
- PHP 型別轉換&&型別強制轉換PHP型別
- 強制型別轉換型別
- SQL中欄位比較型別不匹配錯誤:‘cannot be cast to’SQL型別AST
- SQL Server中型別轉換(將varchar值轉換為資料型別為int的列時發生語法錯誤)SQLServer資料型別
- (int)a、&a、(int)&a、(int&)a的區別
- BigDecimal轉為String型別、int型別Decimal型別
- INT型別知多少型別
- 強制型別轉換之(==)型別
- char轉換成int
- sql int 轉換varcharSQL
- int[] 、 list<int> 、 list<int>[] 的區別
- sql最佳化-錯誤強制型別轉換導致索引失效SQL型別索引
- java 字串轉intJava字串
- Golang 型別轉換庫 castGolang型別AST
- C語言之int *f()、int(*f)()、int *a[]、int (*a)[] 區別小記C語言
- C++強制型別轉換C++型別
- 造型與強制型別轉換型別
- 測試Java中的long,int基本型別Java型別
- 如何在Java中將double轉換為int?Java
- extern int a 和int a的區別
- Ajax接收int型別亂碼型別
- 自動提升為int型別型別
- object-c中NSString與int和float的相互轉換Object
- 1.python報錯:TypeError: 'int' object is not subscriptablePythonErrorObject
- C++ 的強制型別轉換C++型別
- JavaScript中的強制型別轉換JavaScript型別
- C C++ 強制型別轉換C++型別
- sql 在將 nvarchar 值 轉換成資料型別 int 時失敗。SQL資料型別
- 如何在 Go 中將 int 型別轉為字串Go型別字串
- Java中將 int[] 陣列 轉換為 List(ArrayList)Java陣列
- 【java】int轉換成String的四種方法Java