Answer: Null literal
is a null type which indicates that the reference is pointing to no object.
public class Employee
int name, id;
static void Main()
Employee emp = null;
In the above example, we have an Employee
is an object created to Employee
But it is not referring to any object.
If we try to call the variables like,
will throws an error at the runtime
which is known as Null Reference Exception
Asked In: Spotted While Learning |