Runtime Errors
- What does NullPointerException mean in Java?
A NullPointerException (NPE) in Java occurs when you try to use a reference variable that points to null, such as calling a method or accessing a field on it. It means the object you expected doesn't exist. - How do I fix IndexError: list index out of range in Python?
This error means you tried to access a list element at an index that doesn't exist. Check the list length, adjust your index, or use a safer method like a loop or slicing. - What does TypeError: 'NoneType' object is not subscriptable mean?
This error means you tried to use square bracket indexing on a variable that is None. In Python, None is not a container, so you cannot do something like x[0] if x is None. - Why do I get a segmentation fault in C?
A segmentation fault in C occurs when your program tries to access memory it doesn't have permission to access. Common causes include dereferencing null or uninitialized pointers, buffer overflows, and stack overflows. - What does ValueError: could not convert string to float mean?
It means Python tried to turn a string into a floating-point number, but the string wasn't a valid number (e.g., contained letters or symbols). - How do I fix a stack overflow error?
A stack overflow happens when a program uses too much call stack space, usually from infinite recursion or very deep recursion. Fix it by adding a base case, converting recursion to iteration, or increasing the stack size. - What does KeyError mean in Python?
A KeyError means you tried to read a dictionary key that does not exist. Check the key name, confirm it is in the dictionary, or use a safe lookup method like get. - What does RecursionError: maximum recursion depth exceeded mean in Python?
This error means a function called itself too many times without stopping. The usual cause is a missing or unreachable base case in a recursive function. - What does Cannot read properties of undefined mean in JavaScript?
This TypeError means your code tried to read a property, such as user.name, on a value that is undefined. Find where that value should have been set and add a check before using it. - How do I read a stack trace?
Read the error message first, then find the first line that points to your own code. Stack traces list calls from most recent to oldest, so the top frames show where the error happened. - How do I fix 'Unexpected end of JSON input' in JavaScript?
This usually means the code tried to parse an empty or cut-off string as JSON. Check what the request returned, then parse only after confirming the data is complete. - When does a Python warning turn into an error?
Most Python warnings stay warnings until you filter them into errors, such as when running with warnings set to error. Some library behaviors change in newer versions. - What does NullReferenceException mean in C#?
It means your code tried to use an object reference that is null. Check where that reference was assigned, and guard the code path that reads it.