Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class flower{
- name;
- color;
- price;
- static total;
- // getPrice(){
- // return price;
- // }
- // getTotal(){
- // return total;
- // }
- }
- class lily extends flower{
- lily(name, color, price){
- this->name = name;
- this->color = color;
- this->price = price;
- total += price;
- }
- }
- class dandelion extends flower{
- dandelion(name, color, price){
- this->name = name;
- this->color = color;
- this->price = price;
- total += price;
- }
- }
- class chamomile extends flower{
- chamomile(name, color, price){
- this->name = name;
- this->color = color;
- this->price = price;
- total += price;
- }
- }
- public class result {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement