I am using PMD for checking Coding Standards
I am confused about the following below point where PMD is showing Error
- A method should have only one exit point, and that should be the last statement in the method
Currently inside my Method it is as
public boolean validate()
{
if (length == 4) {
return true;
if (length == 2) {
return false;
else
return false ;
return true ;
}
Is my code is wrong ?? and please tell me how can we chage this in case its wrong ??