A NullPointerException (NPE) is a runtime error in programming (common in Java) that occurs when you try to access or use an object reference that has not been initialized (i.e., it points to null).
Example:
String text = null;
System.out.println(text.length()); // Throws NullPointerException
To prevent it, developers use null checks, the Optional class, or safe navigation operators (in some languages).

