私のコンストラクタでこの問題が発生しています。サプライヤクラスからsupplierNameを取得して製品に追加したいと考えています。Javaレストコンストラクタ継承
public class Product {
private long id;
private long barcode;
private String description;
private String zone;
private int quantity;
Supplier supplierName;
public Product(){
}
public Product(long id, long barcode, String description, String zone,
int quantity, Supplier supplierName) {
super();
this.id = id;
this.barcode = barcode;
this.description = description;
this.zone = zone;
this.quantity = quantity;
this.supplierName = supplierName;
}
しかし、問題は、私は私の製品のサービスクラスに
public class ProductService {
private Map<Long, Product> products = DatabaseClass.getProducts();
public ProductService(){
products.put(1L,new Product(1,1,"Lighter","Gift",5000,"Supplier1"));
products.put(2L,new Product(2,2,"Lighter","Gift",3500,"supplier2"));
}
を取得するときにその私にsupplier1
& supplier2
のエラーを与えてあります。
どのようなヘルプもうまくいくでしょう。
どのようなエラーが表示されますか? –
問題に発生しているエラーを追加することができれば助かります。問題の発生場所の行番号を含める必要があります –
'Product'に一致するように引数を削除します – college1