bookitem.java

来自「java编程最好的书籍,感觉对初学者或者中级java人员帮助很大」· Java 代码 · 共 109 行

JAVA
109
字号
package examples;

import java.sql.*;
import javax.naming.*;
import javax.ejb.*;
import java.util.*;
import java.rmi.RemoteException;
import javax.naming.*;

/**
 * A Bookitem is details about the Book.
 * 
 */

public class BookItem implements java.io.Serializable {
    
    /*
     * Base price of the Book
     */
    private double basePrice;
    
    /*
     * Name of the Book
     */
    private String name;
    
    /*
     * Description of the Book
     */
    private String description;
    
    /*
     * Book id
     */
    private String bookId;
    
    /**
     * Constructor
     * @param bookid
     * @param name of the book
     * @param price of the book
     * @param description of the book
     */ 
    public BookItem(String bookId, String name, double price,String description) {
        System.out.println("BookItem(...) called");
        this.bookId = bookId;
        this.basePrice = price;
        this.name = name;
        this.description=description;
	}
    
    /**
     * Returns the Book id.
     */
    public String getBookID(){
        return bookId;
    }
    
    /*
     * Sets the Book id.
     */
    public void setBookID(String bookId){
        this.bookId=bookId;
    }
  
    /**
     * Returns the name of the Book.
     */
    public String getName(){
        return name;
    }
 
    /**
     * Sets the name of the Book.
     */
    public void setName(String name){
        this.name=name;
    }
  
    /**
     * Returns the description of the Book.
     */
    public String getDescription(){
        return description;
    }
    
    /**
     * Sets the description of the Book.
     */
    public void setDescription(String description){
        this.description=description;
    }

    /**
     * Returns the base price of the Book.
     */
    public double getBasePrice(){
        return basePrice;
    }
    
    /**
     * Sets the base price of the Book.
     */
    public void setBasePrice(double price){
        this.basePrice=price;
    }
		
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?