ShoppingCartItem is a javabean where I use products. ShoppingCartItem is not getting comipled.
Code:
package cart.library;
public class ShoppingCartItem
{
private final products products1;
private int quantity;
public ShoppingCartItem(products products1)
{
super();
this.products1=products1;
this.quantity=1;
}
public products getProducts()
{
return products1;
}
public int getQuantity()
{
return quantity;
}
public void setQuantity(int quantity)
{
this.quantity = quantity;
}
public boolean equals(Object obj)
{
return obj instanceof ShoppingCartItem && equals((ShoppingCartItem)obj);
}
public boolean equals(ShoppingCartItem that)
{
return this.products1 == that.products1;
}
}
products.java
Code:
package cart.library;
public class products
{
private String title;
private double price;
private int pid;
private int qty;
private int dis;
public products(int pid, String title, double price, int qty, int dis)
{
super();
this.pid=pid;
this.title=title;
this.price=price;
this.qty=qty;
this.dis=dis;
}
public int getPid()
{
return this.pid;
}
public String getTitle()
{
return this.title;
}
public double getPrice()
{
return this.price;
}
public int getQty()
{
return this.qty;
}
public int getDis()
{
return this.dis;
}
}
