Perform division with proper exception handling. This method should safely divide two decimal numbers and handle division by zero without throwing exceptions.
Examples
Input: dividend = 10.0, divisor = 2.0
Output: 5.0
Explanation: 10.0 divided by 2.0 equals 5.0
Input: dividend = 15.0, divisor = 0.0
Output: null
Explanation: Division by zero returns null instead of throwing exception
Input: dividend = null, divisor = 5.0
Output: null
Explanation: Null dividend returns null
Apex Code Editor
Welcome to Lightning Challenge!
How It Works
- • Write your solution in the code editor
- • Connect your Salesforce org to test
- • Submit to check if your solution passes
- • Use hints if you get stuck
Contest Alert
🏆 #CodeEveryDay July 2026
Contest runs July 1 - 31. Complete challenges to climb the leaderboard!
Only the 31 daily challenges shown during this contest count toward points. Earlier dailies don't carry over.