50% found this document useful (2 votes)
46 views

JAVA

JAVA DEVELOPMENT

Uploaded by

Mohamed Yosry
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
46 views

JAVA

JAVA DEVELOPMENT

Uploaded by

Mohamed Yosry
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

L3 Java Exception Handling in

Temenos T24

for T24 Developers


While writing L3 Java subroutines, we must encounter
Exception like these!

So, let’s dive deeper into Handling them…

MD Shibli Mollah
T24 Technical Analyst
CORE Java Exceptions
Exceptions are unexpected events that can disrupt the normal
flow of a Java program. Effective exception handling is crucial for
robust and reliable software.
T24 supports almost all kinds of core Java exceptions as it’s built
on Core Java.
Here's a list of common core Java exceptions and how to handle
them:
Runtime Exceptions
These exceptions generally occur due to programming errors and
should ideally be prevented rather than handled.
• NullPointerException: Thrown when an attempt to access a null
object.

Handling: Avoid using null values or check for null before accessing
members.
• ArrayIndexOutOfBoundsException: Thrown when we try to access
an array element outside its bounds.

Handling: Validate array indices before accessing elements.


ArithmeticException: Thrown when an arithmetic operation results in
an illegal state, such as division by zero.

Handling: Check for potential division by zero before performing the


operation.

MD Shibli Mollah
T24 Technical Analyst
try-catch block

Apart from the above-mentioned method, there is another way


to resolve exceptions. We can manage them with the help of try-
catch blocks.
Let me share some examples which are as follows:

If we are unsure which Exception occurred then it can be


handled by the example below:

MD Shibli Mollah
T24 Technical Analyst
T24IOException: If we want to write in a local template then it’s a
good practise to handle exception.

Working with DATE.TIME:

General Exception Handling Guidelines


Catch Specific Exceptions: Whenever possible, catch specific
exceptions rather than the generic Exception class to provide
more informative error messages.
Use Finally Blocks: Ensure that resources like files or database
connections are properly closed using a finally block to prevent
leaks.
Log Exceptions: Log exceptions to help with debugging and
troubleshooting.
Avoid Empty Catch Blocks: Empty catch blocks can mask
errors. Always provide meaningful handling or rethrow the
exception.

MD Shibli Mollah
T24 Technical Analyst
By understanding these common exceptions and implementing
proper handling mechanisms, we can create more robust and
reliable Java applications.

MD Shibli Mollah
T24 Technical Analyst

You might also like