Skip to content

Instantly share code, notes, and snippets.

@eliasnogueira

eliasnogueira/Loan.java

Last active Nov 8, 2020
Embed
What would you like to do?
Model example for a loan form
public class Loan {
// private attributes
private String name;
private String email;
private BigDecimal amount;
private int installments;
// constructor
public LoanData(String name, String email, BigDecimal amount, int installments) {
this.name = name;
this.email = email;
this.amount = amount;
this.installments = installments;
}
// getters and setters
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
// others getters and setters ignored (but they're necessary)
@Override
public String toString() {
return "Loan{ \"name='" + name + '\'' +
", email='" + email + '\'' +
", amount=" + amount +
", installments=" + installments + '}';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.