if staments in java string code example Example: if statement with string java if (var.equals("text"))