java - Error: the method getId() is undefined for the type List<Product> -
i have method create list of objects of class public list<product> initproducts(){ list<product> product = new arraylist<product>(); product prod = new product(product.getid(),product.getitemname(),product.getprice(),product.getcount()); product.add(prod); return product; } my product class is: public class product { int itemcode; string itemname; double unitprice; int count; /** * initialise fields of item. * @param name name of member of product. * @param id number of member of product. * @param price price of member of product. */ public product(int id, string name, double price, int c) { itemcode=id; itemname=name; unitprice=price; count = c; } public int getid() { return this.itemcode; } public string getitemname() { return this.itemname; } public double getprice() { return this.unitprice; } public int getcount() { return this.count; } /** * print details members of product class text...