summaryrefslogtreecommitdiff
path: root/oop/04-constructors/AccountTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'oop/04-constructors/AccountTest.java')
-rw-r--r--oop/04-constructors/AccountTest.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/oop/04-constructors/AccountTest.java b/oop/04-constructors/AccountTest.java
new file mode 100644
index 0000000..9774e84
--- /dev/null
+++ b/oop/04-constructors/AccountTest.java
@@ -0,0 +1,23 @@
+
+public class AccountTest {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ Account a1 = new Account(); // Instantiation of 'Account' class
+ Account a2 = new Account(10.0);
+
+ System.out.println(a1.getBalance());
+
+ a1.deposit(100.0);
+ System.out.println(a1.getBalance());
+
+ a1.withdraw(50.0);
+ System.out.println(a1.getBalance());
+
+ a2.deposit(100.0);
+ System.out.println(a2.getBalance());
+ }
+
+}