Hi
im new to java programming and having problems getting my head around defensive programming vs exception handling.
i've read in my uni books about design by contract and the idea of defensive programming but im having problems with it.
so say i write the code.
String container = //some value
if (container.equals.("")) // so if i am looking for a value and find a empty String
{
throw new // a custom exception i have made for this error.
}
else
{
//do whatever i had planned with a non-empty String
}
is this Defensive programming or exception handling. Or am i complete of base.
thanks