Discussion:
[問題] 使用Vector遇到 warning: unchecked
(时间太久无法回复)
antitheist
2006-10-30 17:04:17 UTC
Permalink
主要程式碼:

Vector alist=new Vector();
alist.add(strIn.substring(0,i));

訊息:

warning: [unchecked] unchecked call to add(E) as a
member of the raw type java.util.Vector

alist.add(strIn.substring(0,i));

請問這是為什麼?

--

我認識的人愈多,我就愈喜歡狗


--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.139.160.210
無知的q
2006-10-30 19:12:34 UTC
Permalink
※ 引述《costbook (antitheist)》之銘言:
: warning: [unchecked] unchecked call to add(E) as a
: member of the raw type java.util.Vector
: alist.add(strIn.substring(0,i));
: 請問這是為什麼?

:)

http://forum.java.sun.com/thread.jspa?forumID=316&threadID=702487

--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 163.26.34.213
antitheist
2006-10-31 04:01:53 UTC
Permalink
=== 站內 ===


那...#1880的寫法為什麼可以?



※ 引述《qrtt1 (無知的q)》之銘言:
: ※ 引述《costbook (antitheist)》之銘言:
: : warning: [unchecked] unchecked call to add(E) as a
: : member of the raw type java.util.Vector
: : alist.add(strIn.substring(0,i));
: : 請問這是為什麼?
: :)
: http://forum.java.sun.com/thread.jspa?forumID=316&threadID=702487

--

我認識的人愈多,我就愈喜歡狗


--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.139.156.7
無知的q
2006-10-31 04:26:04 UTC
Permalink
※ 引述《costbook (antitheist)》之銘言:
: === 站內 ===
: 那...#1880的寫法為什麼可以?
: ※ 引述《qrtt1 (無知的q)》之銘言:
: : http://forum.java.sun.com/thread.jspa?forumID=316&threadID=702487

in 1.5

***@ubuntu:~/tomcat/jdk1.5.0_06/bin$ ./javac -Xlint ~/test/TV.java
/home/qrtt1/test/TV.java:10: warning: [unchecked] unchecked call to add(E) as
a member of the raw type java.util.Vector
alist.add(strIn.substring(0,i));
^
1 warning


***@ubuntu:~/tomcat/jdk1.5.0_06/bin$ ./javac ~/test/TV.java
Note: /home/qrtt1/test/TV.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 163.26.34.20

继续阅读narkive:
Loading...