Answers for "if we write String variable in java"

1

how to use string variables with an if statement in java

String a = "Hello"

if (a.equals("Hello") {
	System.out.println("Variable A is Hello");
} else {
	System.out.println("Variable A is not hello :(");
}
Posted by: Guest on August-13-2020
2

java variable in string

String string = String.format("A string %s", aVariable);
Posted by: Guest on September-08-2020

Code answers related to "if we write String variable in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language