市场商铺信息表运行代码

package 市场商铺信息表;

import com.sun.source.tree.NewArrayTree;

public class marketshopsinformation {
    public static void main(String[]args) {
        Fruitstore p = new Fruitstore();//创建水果店对象

        //给水果店商品赋值
        p.Fruits ="火龙果";
        p.price = 9.9;

                //获取水果店对象中的值
        System.out.println(p.Fruits);
        System.out.println(p.price);
        //调用水果店中的方法
        p.sellFruits();
       //创建面馆对象
        Noodlestore a = new Noodlestore();
        a.noodles ="红烧牛肉面";
        a.price =12;

        System.out.println(a.noodles);
        System.out.println(a.price);
          a.setNoodles();

          //创建车店对象
        Carstore b = new Carstore();
        b.name ="大众";
        b.price =199999;

        System.out.println(b.name);
        System.out.println(b.price);

        b.sellcar();

        //创建手机店对象
        Phonstore c = new Phonstore();
        c.name ="华为";
        c.price =1999;

        System.out.println(c.name);
        System.out.println(c.price);

        c.sellphon();

        //创建衣服店对象
        Clothestore d =new Clothestore();
        d.name="耐克";
        d.price=99.99;

        System.out.println(d.name);
        System.out.println(d.price);

        d.sellclothes();

        //创建小超市对象
        Smallsupermarket e =new Smallsupermarket();
        e.name ="矿泉水";
        e.price =2;

        System.out.println(e.name);
        System.out.println(e.price);

        e.sellshop();

        //创建一个烧烤店对象
        Barbecueshop f = new Barbecueshop();
        f.name="鸡翅";
        f.price=8;

        System.out.println(f.name);
        System.out.println(f.price);

        f.sellbarbecue();

        //创建书店对象
        Barbecueshop g =new Barbecueshop();

        g.name="Java编程";
        g.price=99;

        System.out.println(g.name);
        System.out.println(g.price);

        g.sellbarbecue();


        //创建海鲜店对象

        SeafoodShop h =new SeafoodShop();
        h.name="白虾";
        h.price=100;

        System.out.println(h.name);
        System.out.println(h.price);

        h.sellseafood();

        //创建肉店对象
        Butcher i=new Butcher();
        i.name="鸡肉";
        i.price=25;

        System.out.println(i.name);
        System.out.println(i.price);

        i.sellmeat();
    }

}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值