Check out example codes for "how to use string variables with an if statement in java". It will help you in understanding the concepts better.

Code Example 1

String a = "Hello"

if (a.equals("Hello") {
	System.out.println("Variable A is Hello");
} else {
	System.out.println("Variable A is not hello :(");
}

Learn ReactJs, React Native from akashmittal.com