2 I think because 2 I think is binary I’m sorry if this is wrong
Near-perfect eyesight and detail perception would be good traits to have.
Answer:
class Product{
private String name;
private double price;
public Product(String name, double price) {
this.name = name;
this.price = price;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
}
Explanation:
The class Product is implemented above in Java with the set and get methods as well the constructor.
The ProductDemo program is given below:
public class num9 {
public static void main(String[] args) {
Product product1 = new Product("Paties", 4.55);
Product product2 = new Product ("jamies", 5.99);
System.out.println("Product 1 is "+product1.getName()+" The price is " +
""+product1.getPrice());
System.out.println("Product 2 is "+product2.getName()+" The price is " +
""+product2.getPrice());
}
}