Thread applications: Single threaded application Multi threaded application Single Threaded application: Every application starts with a Default thread called “main”. When we invoke the application, JVM create and starts the thread. In single threaded application, …
Multi Tasking: Performing more than one task simultaneously. In computer, every instruction execute by the processor. Processor can execute only 1 instruction at a time. When we try to perform multi tasking, processor space will …
Usage of Exception in General applications: Following program code explains the situation of getting and handling exception while performing money transaction (withdraw) operation in ATM application.
throws: ‘throws’ is a keyword. It is used to specify that a method raises exception from its definition. It is useful to pass the exertion handling process to method calling area when we don’t handle …
Custom Exceptions: Java API providing pre-defined exception classes. Every programmer can define user exceptions also. A custom exception extends the functionality from pre-defined exception classes. Custom exception can be either Checked or Unchecked. Most of …
Throw: It is a keyword. It is used to throw an exception object explicitly by the programmer. Pre-defined exceptions will be raised(thrown) by JVM automatically. Custom exception must be raised manually by the programmer. If …
Unchecked v/s Checked exceptions: Exceptions classified into Checked and Unchecked. Unchecked exceptions handling is optional. Checked exceptions must be handled else compiler raises error. Unchecked Exceptions: The child class of RuntimeException is called Unchecked. Examples… …
Finally: ‘finally’ is a keyword. ‘finally’ is a block of statements. ‘finally’ block is used to release(close) any resource connected to program. Finally block executes whether or not an exception has raised in try block. …
Java Error classes: An Error is a subclass of Throwable. An Error class indicates serious problems that a reasonable application should not try to catch. Most of the errors are abnormal conditions. The java.lang.Errors provides …