Posts

Showing posts with the label Throwable Hierarchy

Changing the Default Terminal to Terminator on Ubuntu

Image
Terminator is a powerful tool for developers, allowing you to manage multiple terminal sessions in a single window. Features like splitting panes, tabs, and simultaneous input can significantly boost your productivity. Step 1: Install Terminator First, install Terminator using the apt package manager. sudo apt update sudo apt install terminator -y The -y option automatically answers 'yes' to any prompts during the installation process, streamlining the setup. Step 2: Set as the System Default Ubuntu uses a utility called update-alternatives to manage default applications. We'll use this tool to change the default terminal emulator ( x-terminal-emulator ) to Terminator. Run the Configuration Command Enter the following command in your terminal. A list of available terminals will appear. sudo update-alternatives --config x-terminal-emulator Select Terminator From the resulting list, enter the selection number corresponding to terminator and press Enter. ...

Java Exception Hierarchy – Throwable, Exception, and Error

Image
Java provides a robust and predictable error-handling system, and at the heart of this system lies the exception hierarchy rooted in the Throwable class. Understanding this hierarchy gives you several advantages: Write cleaner and safer code Respond appropriately and recover from errors Easier debugging and maintenance Build more reliable programs In this article, we’ll visualize the Java exception hierarchy, explain each layer, and cover practical exception handling strategies and best practices you’ll use every day. Java Exception Hierarchy at a Glance 1. Top-Level Class: Throwable At the very top is the Throwable class, which represents anything that can be thrown as an error or exception. It has two main direct subclasses: Error : Serious problems at the JVM or system level (not recoverable) Exception : Application-level issues (recoverable) 2. Error – System/JVM-Level Critical Failures Error represents severe problems that applications should not try ...