Не проходит валидацию, хотя вроде работает верно. Возможно намудрил с классами и надо было все решить проще.
package com.javarush.task.task18.task1827;
public class Good {
public String productName;
public int id;
public float price;
public int quantity;
public Good(int id, String productName, String price, String quantity) {
this.productName=productName;
this.id=id;
this.price=Float.parseFloat(price);
this.quantity=Integer.parseInt(quantity);
}
public Good(String productName, String price, String quantity) {
this.productName=productName;
this.id=-100;
this.price=Float.parseFloat(price);
this.quantity=Integer.parseInt(quantity);
}
public Good() {
}
}