how to check a string in if condition in java code example Example: if statement with string java if (var.equals("text"))