Beginner's Question: "*.java uses unchecked or unsafe operations"
- From: "sunbin" <noSpam@xxxxxxxxxx>
- Date: Wed, 4 Oct 2006 00:01:46 +0800
Hi all
I have read the net and notice this problem is caused by the version of
compiler between 1.5 and 1.4.
I tried to use the follow codes to overcome the warning msg. "uses unchecked
or unsafe operations" but not able to. Please advice. Thanks.
[code]
public class XXX
{
private ArrayList <Customer> CustDB;
.....
.....
public static void main(String[] args)
{
......
......
......
FileInputStream readFile = new FileInputStream("cust.dat");
ObjectInputStream read = new ObjectInputStream(readFile);
CustDB = (ArrayList<Customer>)read.readObject();
}
}
[/code]
I tried to typecast the read object, but yet the warning still exists.
May I know where have I did wrong?
.
- Follow-Ups:
- Re: Beginner's Question: "*.java uses unchecked or unsafe operations"
- From: Thomas Hawtin
- Re: Beginner's Question: "*.java uses unchecked or unsafe operations"
- From: Oliver Wong
- Re: Beginner's Question: "*.java uses unchecked or unsafe operations"
- Prev by Date: Re: Seeking a smarter idiom
- Next by Date: Re: Beginner's Question: Create an identical object.
- Previous by thread: native threads in 1.4 on linux
- Next by thread: Re: Beginner's Question: "*.java uses unchecked or unsafe operations"
- Index(es):
Relevant Pages
|