I am confused about boolean variables. What is the use of boolean variables? We can use short variable (as a flag) for the required purpose then what edge does boolean variables gives us?
if(var == 1)
System.out.println("true");
else
System.out.println("false");