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();
    }

}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
猜你喜欢
  • 2022-02-14
  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
  • 2021-10-24
  • 2018-12-11
  • 2021-06-25
相关资源
相似解决方案