compareto in java string

Solutions on MaxInterview for compareto in java string by the best coders in the world

showing results for - "compareto in java string"
Leo
09 Mar 2020
1System.out.println("hey".equals("hey")); //prints true
2
3/*
4	always use .equals() instead of ==,
5    because == does the compare the string content but
6    loosely where the string is stored in.
7*/
Katlyn
15 Apr 2017
1******Java String compareTo()******
2
3  The Java String class compareTo() method compares the given 
4  string with the current string lexicographically. 
5  It returns a positive number, negative number, or 0.
6  ___________________________________________
7  	if s1 > s2, it returns positive number  
8	if s1 < s2, it returns negative number  
9	if s1 == s2, it returns 0  
10  ___________________________________________
11  
12  
Camilla
14 Nov 2019
1if (aName.equals(anotherName))
2        { 
3            System.out.println(aName + " equals " + anotherName);
4        }
5        else 
6            { 
7                System.out.println(aName + " does not equal " +anotherName );
8                           
9            }
Ariana
09 Nov 2020
1// These two have the same value
2new String("test").equals("test") // --> true 
3
4// ... but they are not the same object
5new String("test") == "test" // --> false 
6
7// ... neither are these
8new String("test") == new String("test") // --> false 
9
Jules
09 May 2017
1class scratch{
2    public static void main(String[] args) {
3        String str1 = "Nyello";
4        String str2 = "Hello";
5        String str3 = "Hello";
6
7        System.out.println( str1.equals(str2) ); //prints false
8        System.out.println( str2.equals(str3) ); //prints true
9    }
10}
Melvin
04 Jun 2018
1// compare two strings in java .equals() method
2public class EqualOperatorDemo
3{
4   public static void main(String[] args)
5   {
6      String str1 = new String("helloworld");
7      String str2 = new String("helloworld");
8      System.out.println(str1 == str2);
9      System.out.println(str1.equals(str2));
10   }
11}
queries leading to this page
compare function strings javahow to compare 2 stringsjava compare 2 strings for equalityjavav compare stringcheck whether two strings are equal or not in javanot equal compare strings javainbuilt function to compare two strings in javastring conparision in javajava if of two string objectscomparision of string in javajava string equal to stringhow to compare string literal in javacompare string function javahow to check if string equals in javajava how to compare stringsjava compare strings with errorsjava compare methodcompare two string javacompare two strings jacahow to check and compare in javajava string compare valuecompareto string method javacompareto string javay should nt we compare number in string javahow to compare 2 strings javastringcompare two strings in java using 3d 3dcompare 28 29 method in javastrcmp in javacompares two strings javajava how compare worksstring1 equals 28string2 29 javacomparing two strings in javain java how to compare two stringsthe string method compareto 28 29 returnshow to write a compareto 28 29 method in javajava compareto in javacompareto 28 29 javajava check strings for equalityhow to compare strings in ajvacompara two string javajava 2b compare stringsusing if to compare strings javacomapre string in javahow do you compare strings in java 3fjava compareable stringcompare two strings are equal in javacompare javahow to equal two strings in javawhat does compare method do in javacompare string in java comaprtorhow to compare two strings in ajvacompare string 5b 5d javacomparing two string in javacheck equality of string in javajava 3d 3d string comparisoncomparing 2 string in javahow to compare 2 strings in java for smallercompareto by string javacomparing string equality javacheck if string equal in javacompareig 2 string javahow to check if strings are equal in javahow to compare the value of two strings in javacomapre two string javajava comparator comparing stringtest if strings are equal javacomparing 2 strings javahow oot compare string in javacomparing strings using the methods equals 28 29 in javacheck if two strings are same in javajava compare a stringhow to compare 2 strings in javastring values are compared using 27 3d 3d 27 2c not 27equals 28 29 27what can you compare with compare to in javahow to compare 2 strings 3fjava check if 2 strings are equal to other 2 stringstwo return types javacan you use 3d 3d to compare strings in javamatch two stringstring 1 string 2how string comparison works in javacomparator java how to compare stringstring compare java 3d 3dcompare stringsequality of stringsthe to compare method javajava same string valuehwo to comate strings in javacompare the two strings in javajava string comparetocompare two strings in java without case sensitivemost reliable way to compare two strings javahow to check 2 strings are equal in javajava string comparasonjava string compare to how it works 3d 3d in string comparison javastring comparison in java with referencejava if statement compare stringsjava compare strinfjava comparingwithjava check if strings are equalcheck two strings are equal in javacomparing 2 stringhow ot compare strinfs in javacompare 2 stringsare strings comparable in javawrite a java program to read two strings from command line argument and check the equality of two string using string function check if two strings are equal in javajava string compareto stringcompare strings jaavcompareto of string in javajava comparing strings with 3d 3dcomapre two strings javajava comparing strnghow do i compare strings in javahow to use to compare method n javahow to compare strings in sjava java how to compare 2 strignsjava how to compare to stringshow to match string in javahow to check if two strings are not the same in javajava how to compare two stringscomparing strings javastring value compare in javaexplain the compare function in javajava string compareto methodhow to compare tow strings in javacompare values in strings javacompare two stringsfastest way of compare strings javahow to campare to string in javacompareto java stringtwo strings equal javajava 2 streing ewqualcompare to string in javastring comare javacompare 2 string in javajava compare string valueshow to compare a string in if condition in javahow to compare two strings in java which is greaterhow to check if a string is equal to another string in javahow to compare substring in javacompareto strings javaequals compare stringcomparing strings with string in javacompare 28 29 in javacheck if 2 strings matches javahow to compare the string value whether they are same or not in java string compareto java examplecompare two strings in if statement javahow to compare strings in javamatch two stringshow to compare two strings in java using ifhow to compare two strings javastring compare methid javacompare string is javacomparing javahow to compare 2 string in javacompaer strings in javastring compareto in javacompare strings in java not equalequals string comparison javahow does compareto work for strings in javacompare twoo strings in javasame string compare stringcompare two strings using boolean function in javacompare string content javahow to compare stringto compare javastring compare javac 2b 2bcompare a string with another string in javacompare twostring in javacomparing strings content javacomaprinf two strings using boole an javaequality in strings with javahow to compare to stringscomparing string in jvajava compare stringmatching two strings codecomparison operator for string in javawhy we cannot compare strings in javajava comparatorstring compare function in javahow to check string value in java 3fjava string 21 3djava compare string equaljava compare textjava test string equalsjava check values of two strings are equalhow to compare strings in jaajava check if string is equal to another stringcheck if 2 string are eaqulcompare to function java stringcomapre strings javaode to compare strings in javacompare 1 value of a string to each other value in the string javastring compare of object javastring method to compare two stringscomparing strings in java if statementhow to string compare in javausing string with compare in javastring compareto javahow to compare with a 22 in javahow to compare two srings javaif with string javacompare method in java for two stringshow can i compare 2 strings in javacompare strings bigger than javacomparing two string 3d 3d javacompare two strings ljavajava 2 string comparehow to check equel between stringa compareto 28b 29 in javahow to write a compare method in javacompare to a javastring compare to javawrite a program to compare two string in javajavatuto to compare string equalitycompare string with equals javacompare in java stringhow to see if two strings are equal in javawhen comparing strings in javacompare string valueschecking string equality in javaimplement compareto strings method in javahow to compare two given strings in javaif string 3d 3d string javacompare 2 strings javajava compare to stringcopmare strings java 3d 3d com 2 stringscompare to javahow to do string comparison in javahow to check if a string is 3d 3d to a different stirng javajava string comparison methodsjava compareto method stringsif string 3d string javacomparing string object in javastring 1 3d 3d string 2how to comapre string in javahow to compare data in strings javajava two string equlaityjava comparing strings using 3d 3dhow you compare two strings in javajava compare scompare string in jvahow string compareto works in javacompareto java iof both string equaljava check if sting is samecheck for string equality javacompare two stirng in javahow to compare string in java eestring compareto method javacheck string equality in javajava compare stirngstwo string compare in javajava string comparisoncomparison two stringsjava compare stringscompare two stringjava string equalitystring comparision in javajava string compare 3d 3d checks for java stringscompare java stringmultiple string comparison in javajava compate stringsjava string compare functioncomparing string in java not equal to same stringstring value comparison in javahow to or two string in javacompare string using 3d 3djava if string is a stringhow to use compare to in javahow to comparison of java stringsif string and string are differentcomare two string in javacompareto between strings javafinal compare strings in javacompare value javahow to compare one string to another in javahow to check whether two strings are equal or not in javajava how to compare string valuescompare two strings javahow does java compares strings using comparetoignorecasecreate a program that takes in two words 2c check for equality ignoring the cases 2c if the words are equal the print the word in javajava checking stingif 2 string matchmethod to check string equalityjava comparetohow to check two strings are equal in java 2c compareto 28 29 2c in java stringjava string comparetocompare 2 strings in jjavahow to check if string equals in java in if statementcomparison of strings in javastring compare in java with equalscompare two strings not equals in javahow to compare 2 strings javacompare sring values javahow to compare if two strings are equal in javahow to test string in javajava can you check if a string 27s address is equalin java 2c how should i compare two strings to see if they are equivalent 3fcompare 2 strings java if statementjava comparisoncompare 2 strings in javabest way to compare strings in javacompare two strings in java ifhow to compare two strings in java 3fsting comparison in javahow ot compare strings javahow to compare a variable with a string in javacompare two words in javahow to compare two strings and check which is greater and smaller in java 3fto compare in javacompare if two strings are equal javahow to compare two elements of a string iin javahow to check two string are truehow to compare 2 strings in java for smallstring comaparitioni javastring comapre javastring and new string compare javacheck if string equal to string javause compareto method for comparing two strings in java 5cjava comparing stringstring comparison in java using equalscomparing two string javajavatuto compare two stringwhich of the following are use to compare a string value 3fcheck if strings arent ewual java equals 28 29 to compare stringshow to equal to stringhow to comparte two tring in javajava how to check if strings are the same valuejava sring comparecompare string in ajvacompareto in javahow to compare the string in javastring comparisonsjava string 3d 3d stringwhat does compareto do in javawhy we dont have string compare 28 29 javacompareto 28 29 java stringscompare javacompareto string in javacompare string java 3d 3dhow to compare strings in an object in javajava compareto methodcompare between two strings in javacan you cmopare strings with 3ehow to check string in javaif 28str 5bi 5d compareto 28str 5bj 5d 29 3e 0 29 meaning in javahow to use compareto in javajava compare sttringsto compare javahow to compare characters in a string in javacomparing strings java with 3ecompare betweeen strings javahow to check equality of two strings in javastring comparisonhow to compare a string to a string in javajava if check stringstring compare to function javadifference in strings valuecompareto 28 29 string javacomparing strings in java not 3d 3d 3d between two stringshow to make a string equal another string javajava equal stringsstring equal comparison in javahow to compare strings in javshow to compare strings in java using if statementshow to compare the two strings in javawrite a program to compare two strings in javacomparing 2 string give falsecompareto in java strnigcheck to strings in javajava comparing two stringjava compare more than two stringscompare string with 22 22 javatext comparison in javahow to compare two strings in java write a java program to compare two string java compare string contentcheck strings in javajava string comapreto compare string values in javajava comparing to strings javahow to compare two strings 3d 3d between 2 strings in javahow to compare 2 binary strings in javacheck equality of two strings in javacheck if a string equals javacomapre strings in javajava string compare onlinejav chk stringcompare string equality javastring operators used to compare with stringcompare strings meaning javaif srting javacommpare two string in javastring comparecompare string java with with part of stringstrings compareto javaare strings comaprable in javacan you compare strings with 3d 3d javacomparing string objects in javajava how are strings comparedcheck if 2 character strings are identical javahow java compare stringscomparison javawap to comparing 2 strings using equals method in javastring java comparehow ot compare string in javacompareto 28 29 method in javacompare two strings in javahow to compare 2 strinjava comparer 2 stringjava compareto functionbefore and after comparison of string javahow to compare two string in javajava string comparison using 3d 3dstring comparison 3e in javacan we compare two strings using 3d 3d in javastring compare method in javajava how to compare two stringcompare two strings if they are equal javahow to comapre two strings in javacompareto javacomparinf string in javajava check for two equal stringscompare strings ajvastring comparison with 3d 3d javacompare to strings javacompareto string method in javaif comparsion for strings javastr compare javacompare 28 29 javacompare value of teo strings in javastring equality in javacompareto method in strings in javajava if string equals stringcompare length of two strings javacompare string value 3e in string comparison javajava compareto two stringsstring comparing javastring comare in jacvajava compare two stringscheck two strings for equality in java 21 3d string javacompares strings in javastrings string comparison in javamost accurate way to compare string in javaequality if string in java compare to javastring comparing functions javajava compare to methodjava string comparisionhow do you compare two strings in javajava compare strings by valuecompare string in jabahow to compare data of string in javacomparing string objectshow to check whether two strings are same in javajava can i compare strings with 3d 3dhow to compare string 5b 5d in javacompare strings jaacompare string values in javacompareto method java stringcompare strinf javajava code for comparing string in datajava compare 26 how to check if a string is equal to something in javacompae stirng javato compare two strings in javahow compare two string in javacomparison between two stringsjava 8 compare stringsjava compare strings with greater thanare this strings equaljava compare string equal tohow to compare two string objects in javastring compare java javacompare strings with 3d 3d javahow to compare string in java using ifjava strings compare equalstring equals javacompare two stringsin java one statementcompare strings javahow to check the equality of string data member to another data member in javastring compare to java 27how do i compare a string name with four other string names in javastring java comparetocheck if strings are different javahow compare strings in javaequality of strings in javatwo string are equal or not java methodcompare with javahow to compare two arrays in javahow to check string equality in javacompare to stringin javahow to compare two stringscheck if 2 string are equal javacreate equal stringscompare method in javareliable way to compare strings javahow tocheck if both strings are equal in javawhy doesn 27t 3d 3d work to compare strings in javahow to compare string in if condition in javajava check stringcreate two strings using new keyword and compare using 3d 3d operator in javatwo string equal javacompare method injavahow do you compare strings in javacompare strings differentjava compare tcompare a string variable with a string in javahow to compare two strings in java using comparatorchecking if strings are equal javacompareto in java stringstring operations java comparing two stringshow to compair string in ifhow to check 2c stringcompare function javabuilstring compare string javacomapre two strings in java compareto in javacompare string javacompare string java examplestring1 3d 3d string2 javahow to use string compare in javacompareto in string javastring coparison jkavajava compare strinscompare string and string object in javacomapre two string in javacompare to use in javahow to compare styring in java 3d 3d string in javahow to compare class string to normal string in javastring compare javawrite a program to compare the strings given below 2c string 1 should be compared with all the other stringshow to compare string in java in if conditionjava compare tocheck if string equeals stringhow to compare string in java examplecomparae string in java java compare stringecompare fubction javacheck if 2 strings are equal javacomparing strings in java with 3d 3di need to use comparator to compare two string typeshow do strings comparewhat method is used to compate two string javaif two strings are equal javahow does compare to work in javacompare two strings in java using inbuilt funjava language check if two strings are equalstring comparision javacompare different string javatwo strings equal in javatest strings equal javacheck string equal in javacompare tp strings javastring equals new stringjava compare two strings similarityand string java ifcomparer 2 string javaequality string in javasee if two strings are equal javajava compare string that have umlathow compare two strings in javajava check equality of stringswhich method is used in string to compare string in javahow to compare string javawhich is the most reliable expression for testing where the value of two string variable are the same 3fcompare two stirngs javajava best string comparisoncompare three strings javacompare two string in jvacompare a string in javato check if two strings are equal in javacomparing two stringscomparing of two strings in javajava compare two string equaljava if of two string objects 3cjava how does compareto workstring comparison in java using ifjava comparetohow are strings compared in java comapring string with the same lenght javahow to compare the strings in javawhen compare string javahow to compare a string in javachack string javawhy can 27t java compare a string in a var with a normal stringcomparing strings if st javacheck if two stringsare equal javacomparing two strings javacompare the content of a string variable in javahow to compare values javastring values are compared using 27 3d 3d 27 not 27equals 28 29 27java how to compare strings with compare methodcompare to in java stringsequate strings javacompare 2 string javajava comparing two stringsjava compare valuejava string comparerhwo to compare two strings in javajava method to equal two stringsif string javajava compare strings greater than stringstring compre javacompare 28 29 javacan i use 3d 3d to compare strings in javamatch string in javastring compered javado strings always need equals to compare in javacamparing two stringjava compareto with string java comparecomparing in javahow does string comparison work in javastring compare to method javacompare to on string prperty javahow to check if string equal in javacompare string in jvavbest way to compare two strings in javastring compare java deviateshwot to compare to strings javacompare content of two stringstring compare javahow to compare strings values in javahow to compare two strings in if condition in javahow to check if two strings are equal javasccompare string in java using 3c 3ecomparing two string values in java less or morecode to compare two strings in javacomparing values of strings javahow to check if two string aare the same in javahow can i compare string in java 3fstring compare 28 29 javajava use 21 3d compare stringjava comparing examplejava compare strings not equalhow to use compareto method in javafastest way to compare strings javacompareto 28 29 string in javajava compare two strings examplehow strings are compare in javacompare strings in if statement javacompare to string javastring compare 28 29 javajava checking string equalitycomparing two strings in java 8can you compare three strings in javajava compare 2 stringjava compare strings greater thancompare of two string in javacompare strings in javajava compare 2 stringscompare substring in javahow to compare string in javacoparing strings javacompare twostrings javacompare function for string in javatest whether strings match javacompare the contents of two string objects in javajava string compare tojava compareto stringscompare strings in jjavacompage string javacan i compare two strings in javacomparing two strings in java with equals 2c compareto 2c 27 3d 3d 27how to compare string in if using javasting compare javaequals or 3d 3d string comparison javahow to check stringhow to compare string with number in if statement in javacheck equality of string javacompare two strings in 5cjavajava best way to compare stringshow to check if 2 strings are equal in javajava compre two stringswhere is compare method in javawhich is better to use for comparing two strings 3a the equals 28 29 function or 3d 3d for strings in java 3fjava check if 2 strings are equalhow to compare two strings are equal in javajava compare two string equal are nothow to check if two strings are equaljava compareto stringhow to check if tow string are equalstring equality javajava compare 2 stirngsstring comparison in javahow to check if two strings are equal in javahow to compare 2 string 3d 3d in javacompare strring javastr compare in javacan 3d 3d be used to compare strings in javahow to check equality of string in javaif condition to compare two strings in javacompare to in javahow to check string is eqaul to another string using in java 3fcompare to in string in javacan you compare strings with 3d 3d in javacheck if string equals string 5b 5d java compareto java stringhow ot do string comparison in javathe 21 3d operator can be used to compare two string objects java string comparison operatorsto compare string in javathe to compare javajava string string comparehow to comapre two string in javacomparing strings with 3d 3d javahow to compare multiple strings in javacompare to method in javajava string compareto 28 29string compare function javastrings comapreto javacompare strings java equalscheck equal strings javaif else string comparison in javajava compare string equal or notfind the difference between two lists in javacheck string equality javawhere to compare two stringsjava string in if comparejava compair string equalsjava string comparrisonstring equals 28new string pramp diff between two stringshow to compare to strings in javacheck if string equalsto compare two string objects 3astring equal checker in javahow to compare works in javacomparing the strings in javahow java compares strings by defaultcompare native string in javaequals between strings javacompare string value in javacompare a part of string in javajava compare if two strings are equalhow toi compare strings in javahow to compare two strings in javasccopmaring string in javacomparing two string variables in javahow does compareto work in javajava comparing stringshow to compare to string in javachecking equality of 2 strings in javastring 3d 3d string java2 string not campare in javacompare string in java if statementjava string equal tocan we compare strings in javaequality string in if in java how to compare strings and variables javatwo equal strings are different javahow to compare two string javahow to compare stirngs javahow to compare two strings in java in orderjava compare two stringstring comparison oin javahow to compare a stringcompareto 28string cadena 29 javacompare equality of two strings in java java comparing 2 stringscompare string equal javacompare one string to anothercheck string value in javacheck if two strings are the same javaproblem in comparing 2 strings javastring comp javacomparing string with 3d 3d in javajava compare stringdcomparing to javahow to compare string values in javawhy can 27t we compare string in java using 3d 3dstring compareto method in javacompare three strings in javacompare two string in havawhat string not compare javastring compare injavacompareto method in javaverify string with 2 variables javacompareto 28 29 in javacompare string to string 5b 5dif string 3d 3d 22 22strings comparision in javajava string comparesjava compares stringcompare strings and or operator in javacompare string and string javajava most reliable way to compare two stringscompare operator string javawhat happens if you compare strings in javacompareto method of string in javacomparing stringsin javahow to compare strings 7ecompare strings javacomparing two strigns in javastrcmp i javacompare with string javajava check if strings are the samejhow to compare strings in javacompareto string function in javajava comapre two stringsmost reliable way to compare strings javajava string compareto code2 strings compare javacan you compare strings in javastring compareto javahow compare a string in javacompare two strings with cosine similarity java compare string javacomparing string in javacompare stirng in javacompare to strings in javastring compare using 3d 3djava arrays comparematch two strings in javacompare strings 5b 5dhow to compare string if javacompare str javacompare function in javajava string check for 5b 5dfunction to see if a strings content is equal to another strings contentcompare tow string in javacomparison of string in javajava if string equalscomparison betwwen strings javaif string 5b2 5d 3d 3d 22 22 compare to in javajava compare strings of different sizewhat is string comparison in javacompareto method in java for stringsjava string comparecheck if string is equal javajava string equals 1 or 2compare to method javacompare string deviation in javajava comparingjavatuto compare string equality compareto java stringsjava compare functionstrings compare javahow to compare tring in javacompare two string in javahow to compare strings javacompare string using comstring meaning comparison javacompare string values javacompareto java stringscompare teo string in javastring comparison using 3d 3d in javacompare char of string in javacan you compare strings using 3cevaluate 2 stringsstring compare to java documentationjaba compare stirngstring comapre in javajava check if two strings are equalcompare text jahow compare works in javacompareable string javahow to compare each string of two strings if they are equals in javahow to chcek string in javawrite an application that compares two strings that a user inputs from the command linehow to compare a variable to a string in javastring comparison methods in javajava how compare stringtext equals method java 285 29 write a program to compare the strings given below 2c string 1 should be compared with all the other stringshow to compare two string variables in javacompare two stringa in jvhow to make two strings equal in javajava comparing strings codecompare in javamethod to compare two strings in javajava sting comparejava string comparison equalsto compare two stringsjava string compare methodcomparing the begining of string values javawhat does java string compareto dohow to compare values of string in javacompare method for string javastring compareto in javastring comparison in java using 3d 3dcompare stings in javahow will you compare string values in javaequal 2 strings javafunction compare between to string in javajava string equals another stringjava comparing string valueshow to compare stinrgs javacomparing string new stirng 28 29 javacan you compare two string in jhavacompareto on string javastring java ifcompare chars in javahow to compare two string if they are equal or not in javajava compareallintitle 3ajava compare two stringsjava comare stringsif string equal to javacheck two strings are equalusing equals to compare stringshow is strings compared in javausing string builder to compare 2 strings in javahow to compare string variables in javahow to compare java stringsset string compare javacheck value of 2 strings javahow to compare strings java 3fcomparestrings javacompare by 3d 3d in javacompare strings equal in javacompareto function in javacheck if two strings are equalhow to compare variable strings in javahow to compare two string in javacompare string to string javacompare strig in javajava string comparison 27java if compare stringsequating two strings in javahow to compair string values in stringwhat does compare do in javaque hace el metodo compare to javacompare strings greater than javacompare in string javacan you compare 2 strings objects using 3ecompareto strings in javawhy w dont have string compare 28 29 javahow to compare if two strings are simularhow to compare multiple strings in equals javastring compaare in javastring compare inm javacorrect way to compare two strings in javatest if two strings are equal javahow to comparer srings in javato test two strings for equality you should use one of the two methods 2bcompare javajava string comparetocomparing to string in javastring 2 strings are equal or notstring compare in javajava compare stingcomparing 2 strings in javahow to compare content of string in javajava string comaretostring comparison greater than in javacompare string value java compare in javajava int comparetojava compare method for stringscompare to strings in javastringhow to check if tow string are equakstring comparison javain java which of these is used to compare two string objects for their equality 3fcompareto method javacan we use 3d 3d to compare strings in javacomparison in javacompare if two strings have same value javacan you compare two strings with 3d 3d in javacomparing strings in javahow does java compares stringscompare values of two strings in javaverify 2 string are equal javahow to compare the two stringscompare string kavacomparing t javastring compare in javacompare string in java if conditionexample of compareto in javajava check values of two strings are the samejava method to compare two stringscompareto in java examplejava compare to stringsequality string javajava to compare string equalitystring 3d 3d in javacomapre string javacompare string in javajava compare strings equalcomparing names in javacompare string in java not equalhow to comapre strings 3e in javacomparing string javacompare method javajava string value comparisonjava comparte 2 stringsstring compareto string javacompare two string according to compare 2 strings and print updated onestring equality check in javacompareto in java string