This is simple but it's getting confuse me, I learnt about body scope is
first line of break point, But below 1'st if
statement getting error (Not a statement) and 2'nd is fine.
I just want only, why getting error?
if (true)
String name="Body Test";
And
if (true) {
String name="Body Test";
}
The Exception:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Syntax error, insert ":: IdentifierOrNew" to complete ReferenceExpression
Syntax error, insert "AssignmentOperator Expression" to complete Assignment
Syntax error, insert ";" to complete Statement String cannot be resolved to a variable