LinkedList newbie
Hi,
Please correct me if I am off the beaten path. I am new to java and I
am trying to use LinkedLists.
I created a class Transaction as my data storage object. I have a class
checkBook that attempts to write create a linkedlist of transactions.
Attached are the 2 files:
public class Transaction
{
Transaction()
{
transType="";
accntTotal=0;
}
public void setTransType(String newTransType)
{
transType = newTransType;
}
public String getTransType()
{
return transType;
}
private String transType;
private double accntTotal;
}
import java.util.*;
public class chequeBook
{
public void chequeBookList()
{
LinkedList tranList = new LinkedList();
// ArrayList tranList = new ArrayList();
Transaction financialTrans = new Transaction();
financialTrans.setTransType("Deposit");
tranList.add(financialTrans);
// System.out.println(tranList.peek().getTransType()+ " from peek");
}
public static void main (String args[])
{
chequeBook chkbook = new chequeBook();
System.out.println("In main method.");
}
}
When attempting to run this little test proggie I get the following:
chequeBook.java:12: warning: [unchecked] unchecked call to add(E) as a
member of
the raw type java.util.LinkedList
tranList.add(financialTrans);
I am totally lost and would greatly appreciate if someone could point
out and explain the warning message.
Thanks in advance...