Friday 31 March 2023

Exception Handling in Apex Part 1

                  In this post, we will see Exception Handling in Apex Programming Language.


An exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the program's instructions.

Program Code:

//Math Exception

Double result=10/0;


//DML Exception

Student__c record=new Student__c();

insert record;

//Null Pointer Exception

String str;


throw new NullPointerException();

No comments:

Post a Comment