标签:main new static double price 小明 library 创建 计算
package com.Summer_0430.cn; /** * @author Summer * 定义一所图书馆Library,有 * 图书 * 书名 * 作者 * 单价 * 管理图书 * * 要求:创建一所图书馆,管理图书 */ class Library{ static class Book{ private String name; private String author; private double price; public Book(String name,String author,double price) { this.author = author; this.name = name; this.price = price; } public void show(){ System.out.println("书名是"+name+"\t作者是"+author+"\t价格是"+price); } } public void management(){ System.out.println("管理图书"); } } public class Test08 { public static void main(String[] args) { Library l = new Library(); l.management(); Library.Book b = new Library.Book("计算机基础", "小明", 22); b.show(); } }
标签:main new static double price 小明 library 创建 计算
原文地址:https://www.cnblogs.com/summerdata/p/10798059.html