تفاصيل العمل

Write a class named Product that contains the following attributes:

productId (Product ID - type: int)

name (Product name - type: String)

price (Product price - type: double)

stock (Quantity in stock - type: int)

The class should include:

Getters and Setters for all attributes.

Ensure that price and stock cannot be negative.

If a negative value is provided, print an appropriate error message.

A Constructor that initializes all attributes when creating an object.

بطاقة العمل

اسم المستقل
عدد الإعجابات
0
تاريخ الإضافة
تاريخ الإنجاز
المهارات