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

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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer this method function It is used to call the constructor of the current class Note 1 You can o... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!