Consider the data definition class identified below. Using terminology learned in the course, briefly (1-2 sentences) explain
Question:
Consider the data definition class identified below. Using terminology learned in the course, briefly (1-2 sentences) explain the purpose of the line of code that states: this();
public class Book { private String isbn; private double cost; private boolean isNew; public Book() { this.isNew = true; } public Book(String isbn) { this(); this.isbn = isbn; } public Book(String isbn, double cost) { this(); this.isbn = isbn; this.cost = cost; } public String getIsbn() { return this.isbn; } public double getCost() { return this.cost; } public boolean isNew() { return this.isNew; } public void setIsbn(String isbn) { this.isbn = isbn; } public boolean setCost(double cost) { if (cost >= 0) { this.cost = cost; return true; } else { return false; } } public void setIsNew(boolean isNew) { this.isNew = isNew; } public boolean discount(double percentage) { if (percentage > 0) { setCost(this.getCost() - this.getCost() * (percentage/100)); return true; } else { return false; } } }
Smith and Roberson Business Law
ISBN: 978-0538473637
15th Edition
Authors: Richard A. Mann, Barry S. Roberts