• 水果类


    package com.hanqi;

    public class shuiGuo {
    private String color;
    private double price;
    public String getColor() {
    return color;
    }
    public void setColor(String color) {
    this.color = color;
    }
    public double getPrice() {
    return price;
    }
    public void setPrice(double price) {
    this.price = price;
    }
    public double getWeight() {
    return weight;
    }
    public void setWeight(double weight) {
    this.weight = weight;
    }
    private double weight;
    }


    }
    private double weight;
    }

    public class fruit {

    public static void main(String[] args) {
    shuiGuo apple=new shuiGuo();
    apple.setColor("红色");
    apple.setPrice(5.5);
    apple.setWeight(10);
    System.out.println(apple.getColor());
    System.out.println(apple.getWeight());
    System.out.println(apple.getPrice());

    }

    }

  • 相关阅读:
    _proto_和prototype的区别
    ajax
    图片预加载
    loading动画
    WinSCP
    检测竖屏 横屏
    webstrom hbuilder快捷键
    vue 引入sass
    npm install -save 和 -save-dev 区别
    打乱数组顺序
  • 原文地址:https://www.cnblogs.com/lizhe313/p/5252704.html
Copyright © 2020-2023  润新知