Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions src/main/java/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ public class Account {
String owner;
double quantity;


public Account(String owner) {
this.owner = owner;
}
Expand All @@ -16,19 +15,11 @@ public Account(String owner, double quantityAdded) {
public String getOwner() {
return owner;
}

public void setOwner(String owner) {
this.owner = owner;
}


public double getQuantity() {
return quantity;
}

public void setQuantity(double quantity) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would you remove this method if it's being used in withdrawQuantity method?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because it is a public method. You are allowing the clients of this class to set any value here.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

this.quantity = quantity;
}

public void addQuantity(double quantity){
if(quantity>0){
updateBalance(quantity);
Expand Down