mirror of
https://github.com/Dichgrem/Java.git
synced 2025-12-16 20:42:00 -05:00
update:demo3
This commit is contained in:
29
com/study/demo3/PrintedBook.java
Normal file
29
com/study/demo3/PrintedBook.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.study.demo3;
|
||||
public class PrintedBook extends Book {
|
||||
private int stock;
|
||||
|
||||
|
||||
public PrintedBook() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public PrintedBook(String isbn, String title, int stock) {
|
||||
super(isbn, title);
|
||||
this.stock = stock;
|
||||
}
|
||||
|
||||
|
||||
public int getStock() {
|
||||
return stock;
|
||||
}
|
||||
|
||||
public void setStock(int stock) {
|
||||
this.stock = stock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PrintedBook [ISBN=" + isbn + ", Title=" + title + ", Stock=" + stock + ", Available=" + available + "]";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user