A NullPointerException in Java occurs when you try to access or manipulate an object reference that has not been initialized
multiple scenarios:
1) int[] arr = null;
int element = arr[0];
2)MyClass obj;
obj.doSomething();
3)Integer num = null;
int value = num;
4)MyClass obj = null;
int result = obj.someMethod();
NullPointerException in Java | How to FIX
#java
Fix NullPointerException in Java
#nullpointerexception