If-else statements are used in java which is used when you want to execute some code based on conditions.
eg:
if(a > 10){ System.out.print(“a is greater”); }
The message “a is greater” will only gets printed when the value if a is greater than 10.