diff options
| author | Kamal Wickramanayake <kamal@inbox.lk> | 2026-02-14 16:37:45 +0530 |
|---|---|---|
| committer | Kamal Wickramanayake <kamal@inbox.lk> | 2026-02-14 16:37:45 +0530 |
| commit | dc803b0ef51898139783a3d0ab49223d8494e936 (patch) | |
| tree | 0fcb517a002abdd65a7bdad309d7894558a9012e /java/06-simple-objects-better/Account.java | |
| parent | 8e07df8db9173c8fb5ad0ff8828c91aa712a87d9 (diff) | |
Added 06-simple-objects-better code
Diffstat (limited to 'java/06-simple-objects-better/Account.java')
| -rw-r--r-- | java/06-simple-objects-better/Account.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/java/06-simple-objects-better/Account.java b/java/06-simple-objects-better/Account.java new file mode 100644 index 0000000..4b26eca --- /dev/null +++ b/java/06-simple-objects-better/Account.java @@ -0,0 +1,26 @@ +public class Account { + + /* Declaring fields - represent state */ + + int accountNumber; + double balance; + + public Account(int accountNumber, double balance) { + this.accountNumber = accountNumber; + this.balance = balance; + } + + public int getAccountNumber() { + return accountNumber; + } + public void setAccountNumber(int accountNumber) { + this.accountNumber = accountNumber; + } + public double getBalance() { + return balance; + } + public void setBalance(double balance) { + this.balance = balance; + } + +} |
