Compliation Error: Recompile with -Xlint:unchecked for details
I am new to Java and am working through Sams Teach Yourself Java2 book. One of the examples gave me a compilation error. The problem code follows:
C:\Java_Work\com\ramyam\ecommerce>java c Storefront.java
Note: Storefront.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
package com.ramyam.ecommerce;
import java.util.*;
publicclass Storefront{
private LinkedList catalog =new LinkedList();
publicvoid addItem(String id, String name, String price, String quant){
Item it =new Item(id, name, price, quant);
catalog.add(it);
}
public Item getItem(int i){
return (Item)catalog.get(i);
}
publicint getSize(){
return catalog.size();
}
publicvoid sort(){
Collections.sort(catalog);
}
}
I think it has something to do with the collections class being outdated. Does anyone have any idea how to fix this?
Thanks in advance,
georgina

