This section teaches you how to organize code using packages and how to work with interfaces to achieve abstraction.
- Packages - Grouping related classes together.
- Access Protection - How access modifiers affect package visibility.
- Interfaces - Defining contracts without implementation.
PackageDemo.java- Show how to create and use a package.StackInterface.java- Implement stack using an interface.
- Write a program showing the usage of a package.
- Write a program to implement a stack using an interface.
Now, move on to Exception Handling.
- TryCatchDemo.java: Demonstrates try, catch, throw, throws, and finally.
- UserDefinedException.java: Demonstrates user-defined exceptions.
- VoterAgeCheck.java: Throws exception if age is less than 18.
- StackException.java: Throws exception if stack is full or empty.
- BankBalanceException.java: Throws exception if bank balance drops below 1000.
- SavingsAccount.java: Demonstrates exception handling in banking operations.