Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java how to compare strings

System.out.println("hey".equals("hey")); //prints true

/*
	always use .equals() instead of ==,
    because == does the compare the string content but
    loosely where the string is stored in.
*/
 
PREVIOUS NEXT
Tagged: #java #compare #strings
ADD COMMENT
Topic
Name
2+7 =