null exception code example
Example 1: exception is null
try
{
}
catch (WebException webEx)
{
Logger.Log("Error while tried to do something. Error: " + webEx.Message);
}
catch (Exception ex)
{
Logger.Log("Error while tried to do something. Error: " + ex.Message);
}
Example 2: null exception
using System;
using System.Collections.Generic;
public class Example
{
public static void Main()
{
List<String> names = new List<String>();
names.Add("Major Major Major");
}
}
Example 3: nullpointerexception java
int x;
x = 10;