In my code inside the class, and outside the function. I have declared a Boolean variable which is set to true. And, I am using if statement on this variable. For example, if the given variable is true the do this else do something else.
But when I try to write code in eclipse. It gives me error stated below:
Syntax error on tokens, ConstructorHeaderName expected instead
I just simply tried to create a boolean variable and assigned true to it (As simple). And then created if statement and put if(x == true). Like this
class Test {
boolean x = true;
if(x == true){
//code
}
else {
//else another code
}
public static void partA(){
//code
}
}