The following code segment will cause the program to crash due
to a NullPointerException being thrown. Modify the code so that the
size assignment statement is surrounded by a try/catch such that
the code will set the value of size to 0 when the exception is
thrown rather than crash.
String str = null;
int size;
size = str.length;