From 6fa0a63b3a594afb02f2bd52b4ea883a75cac0d0 Mon Sep 17 00:00:00 2001 From: Kamal Wickramanayake Date: Sun, 22 Feb 2026 20:20:13 +0530 Subject: oop/inheritance sample code updated --- oop/02-inheritance/CheckingAccount.java | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 oop/02-inheritance/CheckingAccount.java (limited to 'oop/02-inheritance/CheckingAccount.java') diff --git a/oop/02-inheritance/CheckingAccount.java b/oop/02-inheritance/CheckingAccount.java deleted file mode 100644 index a7c19b8..0000000 --- a/oop/02-inheritance/CheckingAccount.java +++ /dev/null @@ -1,20 +0,0 @@ - -public class CheckingAccount extends Account { - - - protected double overdraftLimit; - - - public void withdraw(double amount) { - double finalBalance = balance - amount; - if (finalBalance < 0) { - if (-finalBalance <= overdraftLimit) { - balance = finalBalance; - } else { - // throw exception - } - } else { - balance = finalBalance; - } - } -} -- cgit v1.2.3