Note that there are some explanatory texts on larger screens.

plurals
  1. POBigDecimal in Java error
    primarykey
    data
    text
    <p>There are errors all on everything having to do with the price/ </p> <p>import java.math.BigDecimal;</p> <p>public class Product {</p> <pre><code> // Fields String name; String description; BigDecimal price = new BigDecimal(3.0); int quantity; String barcode; String image; static int count; // Constructors public Product() { name = ""; description = ""; price = 0; quantity = 0; barcode = ""; image = ""; } public Product(String n, String d, double p, int q, String b, String i) { name = n; description = d; price = p; quantity = q; barcode = b; image = i; } // Get/Set methods // description getter and setter public String getDescription() { return description; } public void setDescription(String d) { this.description = d; } // name getter and setter public String getName() { return name; } public void setName(String d) { this.name = d; } // price getter and setter public double getPrice() { return price; } public void setPrice(double d) { this.price = d; } // quantity getter and setter public int getQuantity() { return quantity; } public void setQuantity(int d) { this.quantity = d; } // barcode getter and setter public String getBarcode() { return barcode; } public void setBarcode(String d) { this.barcode = d; } // image getter and setter public String getImage() { return image; } public void setImage(String d) { this.image = d; } </code></pre> <p>}</p> <p>My questions is why is there an error for all of my price parts. I need it to be a big decimal, but how to I fix the errors?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload