(text.equals("Text")) Java Code Simple Explaining
Pramuditha Madura
Bachelor of Technology - BTech at Open University of Sri Lanka. Undergraduate
In Java, the text.equals("Test") statement will return true if the text variable contains the string "Test". If the text variable does not contain the string "Test", the statement will return false.
Here is an example of how to use the equals() method to compare strings in Java:
Test Code :
String text = "Test";
if (text.equals("Test")) {
System.out.println("The strings are equal!");
} else {
System.out.println("The strings are not equal!");
}
This code will print the following output:
The strings are equal!
#java #programming #coding #javascript #developer #python #coder #code #webdeveloper #javafx #spring #hibernate #android #ios #oracle #ibm #microsoft #amazon #google #stackoverflow #javatutorial #javabeginner #javaintermediate #javaadvanced #javainterview #javacareer #javacertification #javabooks #javablogs #javaforums #javameetupsJAV